You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What was expected to happen?
When an event purchase is attempted while the event is on cooldown, the message in chat says how many days until the event can be purchased again.
What actually happened?
The number of days until the event can be purchased is wrong, the event can actually be purchased again sooner.
What could have caused this? (optional but helpful) https://github.com/hodldeeznuts/twitchtoolkit/blob/552a388fd71b663fbb35638eb78e8acb30121e3c/TwitchToolkit/Store/Store_Component.cs#L131 There is no break in this foreach loop, assuming the ids in associateLogIDS are in order from oldest purchase to most recent purchase, the last id iterated and last assigned value of daysTillCooldownExpires will be for the most recent purchase of the event that has yet to expire. Even if the ids in associateLogIDS are not in any particular order, daysTillCooldownExpires will always end up as the last iterated id that has yet to expire which is wrong, it should be the minimum value of daysTillCooldownExpires (not including its initially assigned value, in its declaration, of -1) or otherwise the number of days until the oldest id, that has yet to expire, expires.
The text was updated successfully, but these errors were encountered:
I've looked into this some more since we have ToolkitUtils which has its own event for buying pawns which is where the issue was being noticed. However, I've managed to produce the same behaviour from the meteor event.
I have a feeling that even failed attempts at purchasing the event are sometimes being included in calculating daysTillCooldownExpires as there's no reason that the cooldown time of the event should go up when the event hasn't even been purchased due to it being on cooldown.
What was expected to happen?
When an event purchase is attempted while the event is on cooldown, the message in chat says how many days until the event can be purchased again.
What actually happened?
The number of days until the event can be purchased is wrong, the event can actually be purchased again sooner.
What could have caused this? (optional but helpful)
https://github.com/hodldeeznuts/twitchtoolkit/blob/552a388fd71b663fbb35638eb78e8acb30121e3c/TwitchToolkit/Store/Store_Component.cs#L131 There is no break in this foreach loop, assuming the ids in
associateLogIDS
are in order from oldest purchase to most recent purchase, the lastid
iterated and last assigned value ofdaysTillCooldownExpires
will be for the most recent purchase of the event that has yet to expire. Even if the ids inassociateLogIDS
are not in any particular order,daysTillCooldownExpires
will always end up as the last iteratedid
that has yet to expire which is wrong, it should be the minimum value ofdaysTillCooldownExpires
(not including its initially assigned value, in its declaration, of -1) or otherwise the number of days until the oldestid
, that has yet to expire, expires.The text was updated successfully, but these errors were encountered: