Repository navigation
feat: [SDK-5377] drain session requests on worker start and online (4/4) - #1574
Merged
Merged
Conversation
This was referenced Nov 12, 2026
fadi-george
force-pushed
the
fadi/sdk-5377-drain
branch
from
November 12, 2026 20:12
ece590f to
42f6682
Compare
nan-li
approved these changes
Nov 12, 2026
nan-li
left a comment
There was a problem hiding this comment.
One suggestion. ServiceWorker.ts:937 puts the drain inside the activate waitUntil, so the worker stays in "activating" until the drain finishes, and push and notification click events wait for activation. Offline, executeFetch retries each request for about 2 minutes, so that wait can get long. run() already starts a drain on every worker start, so event.waitUntil(self.clients.claim()) plus void drainSessionRequests() covers it without holding activation.
fadi-george
force-pushed
the
fadi/sdk-5377-drain
branch
from
November 12, 2026 23:05
42f6682 to
9c5c9af
Compare
fadi-george
force-pushed
the
fadi/sdk-5377-drain
branch
2 times, most recently
from
November 12, 2026 23:11
6e0da62 to
c9b674e
Compare
fadi-george
force-pushed
the
fadi/sdk-5377-drain
branch
2 times, most recently
from
November 12, 2026 23:29
8970338 to
5cda268
Compare
fadi-george
force-pushed
the
fadi/sdk-5377-drain
branch
from
November 12, 2026 23:31
5cda268 to
c243b2a
Compare
fadi-george
force-pushed
the
fadi/sdk-5377-drain
branch
2 times, most recently
from
November 12, 2026 23:38
f25ac2b to
dd8f435
Compare
fadi-george
force-pushed
the
fadi/sdk-5377-drain
branch
from
November 12, 2026 23:44
dd8f435 to
8607d5d
Compare
Contributor
Author
|
Good call, done. Activate is back to |
fadi-george
force-pushed
the
fadi/sdk-5377-drain
branch
2 times, most recently
from
November 13, 2026 00:02
8d421b5 to
9dcb19b
Compare
14 of 16 tasks
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-drain
branch
from
November 13, 2026 02:18
9dcb19b to
2fba42f
Compare
13 of 16 tasks
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
Drains the session request queue when the service worker starts, activates, and comes back online.
Details
activatewhile requests retry offline.online: drains when the network returns.Bundle size
OneSignalSDK.sw.jslimit 13.72 kB to 15.03 kB: the sessions client, queue and sender are first bundled here once the worker drains. Earlier PRs in the stack carry their own limit bumps.Stack
Built on #1569 (SDK-5373 sessions API client).
Systems Affected
Validation
Tests
Info
ServiceWorker.test.ts: drain ononline.sender.replay.test.ts: a worker stopped mid-send replays the stored request with the same idempotency key on the next start (separate file since the first drain never settles).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