Skip to content

client: retry the initial inbox state before starting REST polling - #193

Merged
iFixRobots merged 1 commit into
mainfrom
indent/twitter-polling-cursor-retry
Nov 2, 2026
Merged

iFixRobots merged 1 commit into
mainfrom
indent/twitter-polling-cursor-retry

Conversation

@indent

@indent indent Bot commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

After a restart that couldn't reuse the cached session, two logins got HTTP 503: 130: Over capacity from inbox_initial_state.json. Since then every user_updates.json poll has failed the same way (all 6 attempts, then backoff, ~20 give-ups/hour per login for 9+ hours). The polled URL has no cursor parameter. Before the restart, both logins had been polling without errors from a cached session's cursor.

Cause: syncUntrustedChannels is the only place that seeds PollingCursor. When GetInitialInboxState fails it just logs and returns, and connect starts polling anyway with an empty cursor. Nothing ever fetches the initial state again, so message requests and legacy group DMs stop arriving until the next reconnect.

Change: syncUntrustedChannels returns the fetch error, and the polling goroutine retries it with backoff (1 min, doubling up to 30 min) before calling StartPolling. Auth errors still go straight to polling, which already handles them.

View in Indent
Tag @indent to continue the conversation here.

@iFixRobots
iFixRobots requested a review from highesttt November 2, 2026 13:49
@iFixRobots
iFixRobots merged commit 635b354 into main Nov 2, 2026
11 checks passed
@iFixRobots
iFixRobots deleted the indent/twitter-polling-cursor-retry branch November 2, 2026 14:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants