Repository navigation
Recognize existing Twitch EventSub subscriptions whose conditions list empty fields - #1698
Merged
Merged
Conversation
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Every subscribe reconcile re-POSTs
channel.raid(both directions) andchannel.channel_points_custom_reward_redemption.add/.update, and Twitch answers 409 (logged astwitch eventsub createoutcomeexists), costing 2-4 extra Helix requests per subscribe.Root cause: Twitch lists every condition field of a type, filling unused ones with
"". A read-only listing for channel 20135059 returns:Our desired conditions omit those keys, so
reflect.DeepEqualnever matched. The same mismatch let these types slip past the legacy-callback gate.Fix: compare conditions with
sameCondition, which treats empty values as absent, in both the callback gate and the match.Test:
TestReconcileTwitchRecognizesEmptyConditionFieldsfeeds reconcile a Helix-shaped listing with the empty fields and expects a single GET with no POSTs. It fails on main.TestSameConditioncovers the comparison itself.