fix: respect relay 60s rate limit on GET /bundles#197
Merged
Conversation
The relay now enforces a per-account 60s minimum between list_bundles calls (HTTP 429). Two independent React polling hooks both fired immediately on mount and every 60s, causing overlapping requests. - Increase both poll intervals from 60s to 120s (2x safety margin) - Offset identity polling by 60s so the two alternate every 60s - In poll_all_identity_snapshots, run either self-transfer discovery OR invite polling per identity (not both), since each calls list_bundles independently - Downgrade 429 log from warn to debug (non-fatal, self-healing)
With the relay rate limit reduced from 60s to 15s per account,
restore the original 60s poll intervals (with 30s stagger).
- Parse Retry-After header from 429 responses into
RelayRateLimited { message, retry_after_secs }
- Log retry_after_secs at debug level in poll commands
- Restore 60s intervals with 30s identity-poll offset
With the relay poll rate limiter removed from GET /bundles, revert the client workarounds: - Restore original 60s intervals with immediate first poll - Restore both self-transfer discovery AND invite polling per cycle (no mutual exclusion) Keep the Retry-After parsing in RelayRateLimited as defensive code in case rate limiting is re-enabled in the future.
The delta builder's attachment size pre-scan logged a warn for every AddAttachment op whose note was already deleted. This is normal (op log is append-only) — downgrade to debug with a clearer message explaining the blob is unavailable because the note was likely deleted.
careck
added a commit
that referenced
this pull request
May 10, 2026
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.
Summary
Context
The relay added a per-account rate limiter (
RateLimitMiddleware) enforcing 60s minimum betweenGET /bundlescalls. The client was making multiple overlapping calls:useRelayPolling(workspace deltas) — immediate + every 60suseGlobalSnapshotPolling(identity snapshots) — immediate + every 60sAll three could hit the same relay account within the same second, triggering 429.
Test plan