Skip to content

fix failing api calls due to inactive service worker #731

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 3, 2025

Conversation

jkbktl
Copy link
Collaborator

@jkbktl jkbktl commented Jun 30, 2025

PR fixes failing API calls and crashing app ("black screen") when service worker is inactive. First call wakes service worker up and retry is successful.

Bug reports:

Copy link

changeset-bot bot commented Jun 30, 2025

🦋 Changeset detected

Latest commit: b7730c4

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
wallet Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-project-automation github-project-automation bot moved this to 🚧 In Progress in Web & User Interfaces Jun 30, 2025
Copy link

vercel bot commented Jun 30, 2025

@jkbktl is attempting to deploy a commit to the Status Team on Vercel.

A member of the Team first needs to authorize it.

@status-im-auto
Copy link
Member

status-im-auto commented Jun 30, 2025

Jenkins Builds

Click to see older builds (1)
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 1125822 #1 2025-06-30 14:40:06 ~58 sec wallet 📦zip
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ 4541ee9 #3 2025-07-03 11:50:16 ~47 sec wallet 📦zip
✔️ b7730c4 #4 2025-07-03 12:33:54 ~51 sec wallet 📦zip

@jkbktl jkbktl marked this pull request as ready for review July 2, 2025 07:02
@jkbktl jkbktl requested review from a team, felicio, marcelines and Copilot July 2, 2025 07:03
Copilot

This comment was marked as outdated.

@jkbktl jkbktl requested a review from Copilot July 3, 2025 11:49
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR addresses failing API calls and app crashes when the service worker is inactive by adding retry logic that wakes the worker on the first request.

  • Introduces chromeLinkWithRetries to wrap the TRPC Chrome link with wake-and-retry behavior.
  • Updates createAPIClient to use the new retry-enabled link.
  • Adds a changeset entry for a patch release.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
apps/wallet/src/data/chromeLink.ts Adds chromeLinkWithRetries with retry logic for inactive worker.
apps/wallet/src/data/api.ts Switches createAPIClient to use chromeLinkWithRetries.
.changeset/tender-flies-build.md Adds patch release note for the wallet package.
Comments suppressed due to low confidence (1)

apps/wallet/src/data/chromeLink.ts:10

  • The new retry logic in chromeLinkWithRetries isn't covered by existing tests; consider adding unit tests to simulate port disconnection and verify retry behavior.
export function chromeLinkWithRetries<TRouter extends AnyRouter>(

@felicio felicio merged commit f843f87 into status-im:main Jul 3, 2025
3 of 6 checks passed
@github-project-automation github-project-automation bot moved this from 🚧 In Progress to Done in Web & User Interfaces Jul 3, 2025
@jkbktl jkbktl deleted the fix/trpc-client branch July 9, 2025 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants