Repository navigation
[No QA] move PusherPing off the durable write queue - #97702
Conversation
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f89d16e97b
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
The no-multiple-api-calls rule counts `API` tokens per function body, so the third assertion pushed the describe block over the limit. One module-scope mockAPI handle keeps the count at zero inside functions. Drop the pingID shape assertion too: pingPusher builds a typed PusherPingParams, so tsc already guarantees it is a string. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Reviewer Checklist
Screenshots/VideosMacOS: Chrome / SafariScreen.Recording.2026-08-04.at.01.01.03.mov |
|
PR doesn’t need product input as a refactor PR. Unassigning and unsubscribing myself. |
The test advanced no timers, so it only passed because the two watchdog tests ahead of it had already run the 30s ping interval and the mock was never cleared. Run alone it saw zero calls. Clearing the mock and advancing one ping interval makes it independent of test order. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
🚧 mountiny has triggered a test Expensify/App build. You can view the workflow run here. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/mountiny in version: 9.4.51-0 🚀
|
|
🤖 I reviewed the changes and no help site updates are required — so I did not create a draft PR. Why: This PR is an internal networking/plumbing change. It moves the
There is no user-facing behavior here — no UI, feature, setting, tab, or button changes. The help site articles under @adhorodyski, if you believe a specific help article is affected that I may have missed, let me know which one and I'll take another look. |
|
@adhorodyski Can you share the QA steps? |
|
I think we should mark this as No QA |
|
🚀 Deployed to production by https://github.com/roryabraham in version: 9.4.51-1 🚀
Bundle Size Analysis (Sentry): |
Explanation of Change
PusherPingis a 30 second heartbeat that checks the Pusher event path. The client posts a ping over HTTP and the server answers with aPONGover the websocket.It was sent with
API.write, so it was written to disk every 30 seconds, retried up to 10 times with doubling backoff, and could hold the head of the single-flight queue while a real write waited behind it. In a 4 hour window it was the most retried command in the app: 5,075 attempts across 2,924 users, against 1,135 for the next command.This moves
PUSHER_PINGtoSIDE_EFFECT_REQUEST_COMMANDSand sends it withAPI.makeRequestWithSideEffects. That path is not persisted, not retried, and does not touch the queue.API.readwaits for the write queue to drain first, which is the coupling being removed.The probe stays.
checkForLatePongRepliescallsPusher.reconnect()when aPONGgoes missing, which shipped in #96883.Fixed Issues
$ #97712
PROPOSAL:
Tests
tests/unit/PusherPingPongTest.ts: the existing watchdog tests needed a mock fix, because the automocked@libs/APIreturnsundefinedandpingPushernow chains a.catchon the returned promise. Added one assertion that the ping goes out throughmakeRequestWithSideEffectswithPusherPingand that the old write path is not called. Verified it fails against the old call and passes against the new one.Also ran
tests/unit/APITest.ts,tests/unit/SequentialQueueTest.ts,tests/unit/NetworkTest.tsxandtests/unit/RequestTest.ts. All pass.Manual check for a reviewer: sign in, wait a minute, and confirm the
[Pusher PINGPONG] Received a PONG event from the serverlog still arrives and thatPusherPingno longer appears inPERSISTED_REQUESTS.Offline tests
N/A
QA Steps
Same as tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari