Repository navigation
feat: [SDK-5377] add SessionRequests IndexedDB store (1/4) - #1571
Merged
Merged
Conversation
This was referenced Nov 12, 2026
fadi-george
force-pushed
the
fadi/sdk-5377
branch
2 times, most recently
from
November 12, 2026 23:10
6fd5617 to
575aed4
Compare
fadi-george
force-pushed
the
fadi/sdk-5377
branch
from
November 12, 2026 23:11
575aed4 to
4aad841
Compare
This was referenced Nov 13, 2026
Bumps the database to v8 with a SessionRequests store for queued sessions API requests, written only by the service worker. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
fadi-george
force-pushed
the
fadi/sdk-5377
branch
from
November 13, 2026 02:18
3e1f494 to
0d66333
Compare
13 of 16 tasks
sherwinski
reviewed
Nov 13, 2026
sherwinski
left a comment
Contributor
There was a problem hiding this comment.
Flagging for awareness:
This bump starts an upgrade for every existing user. openDB does not close on versionchange. blocked() only logs, and the db.* functions await dbPromise before the guard starts its timer. So a tab on an older SDK then blocks the v8 open, and every db call will wait indefinitely.
It looks like #1575 fixes part of this, but tabs on the released SDK will still block so consider adding a timeout on open?
This might not be worth taking action over, I'll leave it up to you to decide.
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
Adds
SessionRequestsandSessionRequestStatesIndexedDB stores (DB v8) for queued sessions API requests.Details
Session requests need to survive service worker restarts and offline periods. The service worker owns this store; the page never writes to it.
SessionRequestskeyed byidandSessionRequestStateskeyed by local session ID.SessionRequestRecord: create and update records with the idempotency key, queue order, attempts and next send time.SessionRequestState: the server session ID and create time, written when a create succeeds. It outlives the create record so later updates and ends find the server ID (like AndroidSessionStateModel/ iOSSessionState).OneSignalSDK.page.es6.jsto 47.09 kB andOneSignalSDK.sw.jsto 13.72 kB for the DB upgrade.Stack
Built on #1569 (SDK-5373 sessions API client).
Systems Affected
Validation
Tests
Info
Upgrade test from v7 with existing
Optionsandoperationsdata, and writes to both new stores.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