Skip to content

Keep a parked Twitch reconcile through a stale revocation, and share the subscriptions HTTP client - #1699

Merged
kevmo314 merged 1 commit into
mainfrom
agent/queue-keep-reconcile
Oct 24, 2026
Merged

kevmo314 merged 1 commit into
mainfrom
agent/queue-keep-reconcile

Conversation

@kevmo314

Copy link
Copy Markdown
Contributor

Follow-ups from the #1694 review.

Lost reconcile: subscribeTwitch enqueues a reconcile while it still holds the twitch:<id> lease, so the worker parks the reconcile as busy for 5s. If a late authorization_revoked revocation from an earlier deauthorization lands in that window, EnqueueRemove overwrites item.job. The removal then sees the broadcaster re-authorized, skips, and deletes the item, so the reconcile is gone and no subscriptions get created until the next subscribe. Items now carry a reconcile flag that is set whenever a reconcile is requested. A removal that ends with outcome reauthorized switches the item back to the reconcile with fresh retry state instead of dropping it. A removal that actually deletes still drops the item, so a real deauthorization after a subscribe still wins.

Tests in TestTwitchQueueLatestIntentWins:

  • stale revocation while reconcile is parked fails on main.
  • re-authorized without a reconcile checks that a plain skipped removal does nothing.

HTTP client: cmd/main.go left subscriptions.API.Client nil, so every Helix request (now including the /users re-authorization check) built a new http.Client. One client is now shared between provider.NewService and API.Client, the same way jobs.go does it.

…dcaster re-authorized, and share the subscriptions HTTP client
@kevmo314
kevmo314 merged commit 1d20d6f into main Oct 24, 2026
13 checks passed
@kevmo314
kevmo314 deleted the agent/queue-keep-reconcile branch October 24, 2026 06:12

This branch was successfully deployed

2 active deployments
ios-testflight — a6f4081c Deployed Oct 24, 2026 by kevmo314 via ios / ipa #1755
android-internal — a6f4081c Deployed Oct 24, 2026 by kevmo314 via android / apkaab #1755
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant