Repository navigation
feat: [SDK-5377] enqueue policy for session requests (2/4) - #1572
Merged
Merged
Conversation
This was referenced Nov 12, 2026
nan-li
reviewed
Nov 12, 2026
nan-li
left a comment
There was a problem hiding this comment.
Two notes:
queue.ts:89When an end replaces queued updates, it's built from the new request only. If the sender already stamped one of those updates withserverSessionId(the create succeeded and the update is waiting out the 5s delay), the end loses it andpickNextdrops the end. Carrying the server fields over from the replaced update fixes it, and so does looking the ID up at send time as suggested on #1573.queue.ts:76"Only one unsent duration-only update can exist" stops being true once an in-flight update gets a retry. Then there are two, and the next update coalesces into the older one. The backend never lowers a duration, so the only cost is one extra request. Either fix the comment or coalesce into the newest update.
fadi-george
force-pushed
the
fadi/sdk-5377-enqueue
branch
from
November 12, 2026 23:05
1b8e85a to
122b829
Compare
Contributor
Author
|
Thanks, both fixed.
|
fadi-george
force-pushed
the
fadi/sdk-5377-enqueue
branch
2 times, most recently
from
November 12, 2026 23:11
39d7c3e to
834ada5
Compare
fadi-george
force-pushed
the
fadi/sdk-5377-enqueue
branch
2 times, most recently
from
November 12, 2026 23:38
6867f66 to
242a317
Compare
fadi-george
force-pushed
the
fadi/sdk-5377-enqueue
branch
2 times, most recently
from
November 12, 2026 23:57
3c6da2b to
aa79ae2
Compare
14 of 16 tasks
Queues sessions API create/update records in SessionRequests with an idempotency key per request. Duration-only updates coalesce to the highest duration, an end replaces unsent updates, updates after an end are dropped, and the queue is capped at 100 (a dropped create takes its updates). Requests older than 30 days can be dropped. The request in flight is never touched. Co-Authored-By: Claude Opus 5.5 <[email protected]>
fadi-george
force-pushed
the
fadi/sdk-5377-enqueue
branch
from
November 13, 2026 02:18
aa79ae2 to
8b261c2
Compare
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.
Description
1 Line Summary
Queues session create/update records with ordering, coalescing, an end replacing updates, and a cap.
Details
navigator.locks.request), so an enqueue never interleaves with the sender applying a result. Web Locks ship in Chrome 69, Firefox 96 and Safari 15.4; Safari web push needs 16+. Older Chrome/Firefox with VAPID push lack it, so the SDK-5381 wiring should only use the sessions API whennavigator.locksexists. Tests use a small per-name fake (__test__/support/helpers/locks.ts) since jsdom has none.Nothing enqueues yet; wiring is SDK-5381.
Stack
Built on #1569 (SDK-5373 sessions API client).
Systems Affected
Validation
Tests
Info
queue.test.ts: order and keys, coalescing with a new key, end replacing updates, drops after an end, per-session isolation, cap, cap with create, age limit.vp checkclean (only existing warnings), fullvp run testpasses, each PR in the stack passes on its own. Not tested in a browser: nothing enqueues session requests until the lifecycle wiring (SDK-5381).Checklist
Programming Checklist
Interfaces:
Functions:
Typescript:
Other:
elem of arraysyntax. PreferforEachor usemap. Usesfor...ofwhere IndexedDB writes must run in sequence.contextif possible.Screenshots
Info
No UI changes.
Checklist
Related Tickets
SDK-5377
🤖 Generated with Claude Code