-
Notifications
You must be signed in to change notification settings - Fork 119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
onWidgetLoad and onSessionUpdate data schemas do not match. #9
Comments
@justlx, would you mind taking a look at this when you get a chance? It would be incredibly useful to have |
Testing events create different data than real ones (they add more stuff to different endpoints as it doesn't matter there). The reason behind that is to allow user checking their scripts with emulation. Data structure onWidgetLoad and onSessionUpdate stays the same for real events. |
@justlx Thanks for the response and clarity on the decision that was made. I'd like to take this opportunity to present a use case that would defend keeping the integrity of the schema intact. Scenario: Create a widget which shows a progress bar towards a goal, where the goal is a choice between subscribers/subscriber points/etc. Implementation:
Concerns:
Suggestions:
-- As an aside: my understanding is that there are three events broadcast on From the looks of it,
By making sure each serve an explicit purpose, the handlers bound to each event become more clear in their purpose. While a subscription event will trigger both |
Please, its necesary:
|
The documentation for
onSessionUpdate
says that the schema for the data that comes through for a session ononSessionUpdate
matches the data that comes through ononWidgetLoad
. See here: https://github.com/StreamElements/widgets/blob/master/CustomCode.md#on-session-updateHowever, upon attempting to use
subscriber-points
(along with various other subscriber-specific properties), the data does not match.For example:
onWidgetLoad
session data hassubscriber-points
with a value like{ amount: 1 }
onSessionUpdate
session data hassubscriber-points
with a value that represents the latest subscriber, such as{ type: "subscriber", name: "Joscelin", ... }
The text was updated successfully, but these errors were encountered: