Repository navigation
Handle ServiceWorker lifecycle - #357
Conversation
Deploying wallet-bitcoin with
|
| Latest commit: |
1bd3a4a
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://dcebfb55.wallet-bitcoin.pages.dev |
| Branch Preview URL: | https://handle-sw-lifecycle.wallet-bitcoin.pages.dev |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review (1)
Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
WalkthroughThe PR updates pre-release dependency versions, adds status ping interval cleanup to wallet lock logic, and refactors service worker activation to support skip-waiting triggering instead of forcing client page reloads. Changes
Sequence Diagram(s)sequenceDiagram
participant Client as Client/App
participant SW as Service Worker
participant Cache as Cache Storage
rect rgba(100, 150, 200, 0.5)
Note over Client,Cache: New Service Worker Activation Flow
Client->>SW: Send SKIP_WAITING message
activate SW
SW->>SW: self.skipWaiting()
end
rect rgba(150, 200, 100, 0.5)
Note over Client,Cache: Activation Event
SW->>Cache: Clean up old caches
SW->>SW: Claim all clients
SW-->>Client: Ready for new version
deactivate SW
end
Estimated code review effort🎯 2 (Simple) | ⏱️ ~15 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Deploying wallet-mutinynet with
|
| Latest commit: |
1bd3a4a
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://5d83d6a3.arkade-wallet.pages.dev |
| Branch Preview URL: | https://handle-sw-lifecycle.arkade-wallet.pages.dev |
|
@CodeRabbit review - we're closing the circle with what was implemented her arkade-os/ts-sdk#329 to ensure the Service Worker never gets stuck across releases. |
|
🧠 Learnings used✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
🧹 Nitpick comments (1)
src/wallet-service-worker.ts (1)
14-17: WrapskipWaiting()inevent.waitUntil()to extend worker lifetime during activation.The
ExtendableMessageEventsupportsevent.waitUntil(promise)to keep the service worker alive while async work completes. SinceskipWaiting()returns a promise that resolves once activation is attempted, wrapping it ensures the browser doesn't terminate the worker mid-transition.Suggested patch
self.addEventListener('message', (event: ExtendableMessageEvent) => { if (event.data?.type === 'SKIP_WAITING') { - self.skipWaiting() + event.waitUntil(self.skipWaiting()) } })🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@src/wallet-service-worker.ts` around lines 14 - 17, The message handler that listens via self.addEventListener and checks for event.data?.type === 'SKIP_WAITING' should call skipWaiting() inside event.waitUntil(...) so the service worker stays alive until activation completes; update the handler for ExtendableMessageEvent to call event.waitUntil(self.skipWaiting()) instead of calling self.skipWaiting() directly.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@src/wallet-service-worker.ts`:
- Around line 14-17: The message handler that listens via self.addEventListener
and checks for event.data?.type === 'SKIP_WAITING' should call skipWaiting()
inside event.waitUntil(...) so the service worker stays alive until activation
completes; update the handler for ExtendableMessageEvent to call
event.waitUntil(self.skipWaiting()) instead of calling self.skipWaiting()
directly.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 841272ff-a047-4229-9c06-a65df9a8201a
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (5)
.gitignorepackage.jsonpublic/wallet-service-worker.mjssrc/providers/wallet.tsxsrc/wallet-service-worker.ts
Depends on arkade-os/ts-sdk#329
Summary by CodeRabbit
Release Notes
Chores
Bug Fixes
Refactor