Firebot icon indicating copy to clipboard operation
Firebot copied to clipboard

[Bug] Bits Badge Event doesn't trigger due to error

Open dennisrijsdijk opened this issue 1 year ago • 1 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Current Behavior

Whenever a viewer unlocks a bits badge and sends the "bits badge unlocked" message/alert through Twitch, Firebot doesn't detect the bits badge event and throws the error shown below

Expected Behavior

Firebot should not throw any error, and should process the bits badge event.

Steps To Reproduce

  1. Have an Affiliate or Partner channel.
  2. Have a viewer unlock a bits badge.
  3. Have the viewer share the bits badge message/alert.
  4. Observe error in developer console or log file.

Version

5.62.1

What operating system are you using Firebot on?

Windows 11

Relevant log output

[2024-04-28 20:55:39.0552] - error: [v5.62.1] TypeError: Cannot read properties of undefined (reading 'user_name')
    at get userName [as userName] (C:\Users\danhu\AppData\Local\firebot\app-5.62.1\resources\app.asar\node_modules\@twurple\pubsub\lib\messages\PubSubBitsBadgeUnlockMessage.js:20:50)
    at PubSubHandler._callback (C:\Users\danhu\AppData\Local\firebot\app-5.62.1\resources\app.asar\build\backend\twitch-api\pubsub\pubsub-client.js:63:70)
    at PubSubHandler.call (C:\Users\danhu\AppData\Local\firebot\app-5.62.1\resources\app.asar\node_modules\@twurple\pubsub\lib\PubSubHandler.js:38:14)
    at C:\Users\danhu\AppData\Local\firebot\app-5.62.1\resources\app.asar\node_modules\@twurple\pubsub\lib\PubSubClient.js:63:33
    at BasicPubSubClient.emit (C:\Users\danhu\AppData\Local\firebot\app-5.62.1\resources\app.asar\node_modules\@d-fischer\typed-event-emitter\lib\EventEmitter.js:31:17)
    at BasicPubSubClient._receiveMessage (C:\Users\danhu\AppData\Local\firebot\app-5.62.1\resources\app.asar\node_modules\@twurple\pubsub\lib\BasicPubSubClient.js:313:22)
    at C:\Users\danhu\AppData\Local\firebot\app-5.62.1\resources\app.asar\node_modules\@twurple\pubsub\lib\BasicPubSubClient.js:94:18
    at PersistentConnection.emit (C:\Users\danhu\AppData\Local\firebot\app-5.62.1\resources\app.asar\node_modules\@d-fischer\typed-event-emitter\lib\EventEmitter.js:31:17)
    at C:\Users\danhu\AppData\Local\firebot\app-5.62.1\resources\app.asar\node_modules\@d-fischer\connection\lib\PersistentConnection.js:83:46
    at WebSocketConnection.emit (C:\Users\danhu\AppData\Local\firebot\app-5.62.1\resources\app.asar\node_modules\@d-fischer\typed-event-emitter\lib\EventEmitter.js:31:17) uncaughtException

Contact Details (Optional)

No response

dennisrijsdijk avatar Apr 28 '24 22:04 dennisrijsdijk

Since PubSub deprecation has been announced by Twitch, we'll leave this for now until we can migrate that event to EventSub.

zunderscore avatar Apr 29 '24 15:04 zunderscore