Follow-up to #1301 (channel point redemptions, PR #1307). None of these blocked the merge; they were deferred from the whole-branch review so the feature could ship for streamer testing.
1. EventSub reconnection hardening
The redemption EventSub subsystem (internal/chat/twitch/eventsub.go) is functionally correct and non-critical (no failure disrupts chat), but its reconnect path has three robustness gaps that are best fixed together with one reconnection-hardening test:
- Reset backoff after a healthy session.
run()'s backoff grows monotonically to the 30s cap and is never reset after a session that reached session_welcome. An isolated drop following an earlier flap then waits the full accumulated backoff before redemptions resume. Reset to the initial 1s once a session becomes healthy.
- Explicit welcome-window read deadline.
serve() sets no read deadline before the welcome frame arrives, so a half-open pre-welcome connection blocks ReadMessage indefinitely (only Stop() unblocks it). Add a bounded read deadline for the welcome frame.
- Bounded retry on transient (non-auth) subscribe failure. A transient (e.g. Helix 5xx / network) failure in
subscribe() is silently dropped with no client-side retry; it self-heals only because Twitch closes an un-subscribed socket ~10s after welcome — which, combined with the non-reset backoff above, can settle into a 30s reconnect spin. Add a small bounded retry.
Also: add a one-line doc comment marking the accepted spurious-logout race (an in-flight subscribe goroutine racing a user disconnect at the exact moment a real 401 returns) as an intentional trade-off — it is substantively correct (the token really is dead) and rare, so it is deferred, not fixed.
2. Screenshots + website update
The redemptions feature adds a visible capability (a Twitch Account section in settings + a new redemption event line in the chat feed), so per AGENTS.md this means:
- Refresh the screenshots in
website/assets/ to show the new Twitch Account settings section and a redemption appearing in the overlay.
- Update
website/index.html (hero, features, FAQ) to mention channel point redemptions.
Website is live at getghostchat.com. New/updated screenshots need to be captured from a real build with a connected account.
References
Follow-up to #1301 (channel point redemptions, PR #1307). None of these blocked the merge; they were deferred from the whole-branch review so the feature could ship for streamer testing.
1. EventSub reconnection hardening
The redemption EventSub subsystem (
internal/chat/twitch/eventsub.go) is functionally correct and non-critical (no failure disrupts chat), but its reconnect path has three robustness gaps that are best fixed together with one reconnection-hardening test:run()'sbackoffgrows monotonically to the 30s cap and is never reset after a session that reachedsession_welcome. An isolated drop following an earlier flap then waits the full accumulated backoff before redemptions resume. Reset to the initial 1s once a session becomes healthy.serve()sets no read deadline before the welcome frame arrives, so a half-open pre-welcome connection blocksReadMessageindefinitely (onlyStop()unblocks it). Add a bounded read deadline for the welcome frame.subscribe()is silently dropped with no client-side retry; it self-heals only because Twitch closes an un-subscribed socket ~10s after welcome — which, combined with the non-reset backoff above, can settle into a 30s reconnect spin. Add a small bounded retry.Also: add a one-line doc comment marking the accepted spurious-logout race (an in-flight
subscribegoroutine racing a user disconnect at the exact moment a real 401 returns) as an intentional trade-off — it is substantively correct (the token really is dead) and rare, so it is deferred, not fixed.2. Screenshots + website update
The redemptions feature adds a visible capability (a Twitch Account section in settings + a new redemption event line in the chat feed), so per
AGENTS.mdthis means:website/assets/to show the new Twitch Account settings section and a redemption appearing in the overlay.website/index.html(hero, features, FAQ) to mention channel point redemptions.Website is live at getghostchat.com. New/updated screenshots need to be captured from a real build with a connected account.
References