Skip to content
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

Points spent events are never processed #103

Closed
Rakambda opened this issue Mar 4, 2021 · 4 comments
Closed

Points spent events are never processed #103

Rakambda opened this issue Mar 4, 2021 · 4 comments
Labels
bug Something isn't working

Comments

@Rakambda
Copy link
Contributor

Rakambda commented Mar 4, 2021

While testing #96 I wondered why the points spent never showed up.

Seems to be that the payload sent by twitch doesn't work the same as when points are earned (everything hidden in red is my channel id):
image

The channel_id of the message isn't the id of the watched channel, but the id of our channel
Basically it seems like the channel_id is the one of the channel that sent points:

  • when winning points it's the streamer, as it gives points to us
  • when spending it's us as we give points to the streamer

So when we try to get the streamer, it always returns -1 (message.channel_id != ws.streamers[i].channel_id when points are spent).

streamer_index = get_streamer_index(ws.streamers, message.channel_id)
if streamer_index != -1:

@Rakambda Rakambda added the bug Something isn't working label Mar 4, 2021
@Tkd-Alex
Copy link
Owner

Tkd-Alex commented Mar 4, 2021

Then? I don't understand this issue.
We aren't unable to know where we have spent the points, but as you already say the Twitch payload don't share the channel_id of the streamer but our id.

@Tkd-Alex
Copy link
Owner

Tkd-Alex commented Mar 4, 2021

OK. I've read your comment #96.
So you think we should find a way to know where we have spent the points, so we can adjust the chart?

@Rakambda
Copy link
Contributor Author

Rakambda commented Mar 4, 2021

Well, in the analytics branch you clearly use that event, which to me makes sense (to update the chart when we spend points)

if message.type in ["points-earned", "points-spent"]:

Though the way the event is handled, it'll never go past that check:

streamer_index = get_streamer_index(ws.streamers, message.channel_id)
if streamer_index != -1:

@Tkd-Alex
Copy link
Owner

Tkd-Alex commented Mar 4, 2021

I'm feel so stupid 😢
You are right!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants