[NOQA] Improve network logging: distinguish client requestIndex from server requestID - #91948
Conversation
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 26a5389ba8
ℹ️ 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".
| } | ||
| const previousLength = persistedRequests.length; | ||
| persistedRequests = persistedRequests.filter((r) => r.requestID == null || diskIDs.has(r.requestID)); | ||
| persistedRequests = persistedRequests.filter((r) => r.requestIndex == null || diskIDs.has(r.requestIndex)); |
There was a problem hiding this comment.
Preserve legacy request IDs during queue reconciliation
When users upgrade with offline writes already stored in ONYXKEYS.PERSISTED_REQUESTS, those records still have the old requestID field and no requestIndex. In the cross-tab reconciliation path, those legacy rows now satisfy r.requestIndex == null and are kept in memory even after another leader tab removes them from disk, so a follower tab can later replay an already-processed write (e.g. duplicate comment/expense) if leadership changes. Please migrate/fallback to the old requestID when building the ID set and filtering, or normalize persisted requests on load.
Useful? React with 👍 / 👎.
iwiznia
left a comment
There was a problem hiding this comment.
Looks good to me, can you check that the network logs now correctly log the requestID coming from the servers please?
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppandroid.movAndroid: mWeb ChromeiOS: HybridAppios.moviOS: mWeb Safari |
|
PR doesn’t need product input as a logging PR. Unassigning and unsubscribing myself. |
Checked, and it logs correctly: |
|
@situchan can you please review and ping me when you approve? |
ReviewTL;DR: Behavior change is correct and minimal. Two small polish items + a coverage gap worth flagging before merge. What the PR does
Manual verification posted by Findings1. Stale identifier names in The comments were updated from "requestIDs" → "request indexes" but several variable names still talk about IDs even though they now hold indexes:
Since this PR is explicitly about the client-index vs server-ID terminology split, leaving these names as 2. Migration shim has no end-of-life marker
Suggest a one-liner: // Fallback to legacy `requestID` to handle requests persisted before requestID→requestIndex rename. Safe to remove after ~1 release.3. New Server 4. Coverage / tests
Correctness check
RiskLow. Change is mostly mechanical rename; the only new runtime behavior is |
|
Codex Review: Didn't find any major issues. Swish! ℹ️ About Codex in GitHubCodex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
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". |
|
@iwiznia looks like this was merged without a test passing. Please add a note explaining why this was done and remove the |
|
🚧 @iwiznia has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
Tests had passed and not an emergency |
… rename Use getClientRequestIndex() for knownOngoingRequestIDs tracking and update MiddlewareTest fixtures to requestIndex so typecheck and lint pass on main. Co-authored-by: Cursor <cursoragent@cursor.com>
|
🚀 Deployed to staging by https://github.com/iwiznia in version: 9.3.91-0 🚀
Bundle Size Analysis (Sentry): |
|
🤖 No help site changes required. I reviewed the changes in this PR against the help site files under Why: This PR is an internal network-logging improvement with no user-facing impact. It:
All touched files are developer-facing infrastructure ( A grep of Since no changes are required, I have not created a draft help site PR. |
|
🚀 Deployed to staging by https://github.com/iwiznia in version: 9.3.94-0 🚀
Bundle Size Analysis (Sentry): |
|
🤖 Help site review: no changes required I reviewed the changes in this PR against the help site files under Why: This is a purely internal networking/logging change with no customer-facing impact:
These are developer-facing log/diagnostic concepts. They don't touch any feature name, tab, settings label, button, or user-facing workflow that the help site documents. A grep of Since no help site changes are needed, I have not created a draft PR. |
|
🚀 Deployed to production by https://github.com/luacmartins in version: 9.3.94-0 🚀
|


Explanation of Change
This PR replaces the client-side
request.requestIDfield withrequestIndexand forwards the server-issuedresponse.requestIDontoHttpsErrorso error logs surface both IDs distinctly — clientrequestIndexand serverrequestID— instead of colliding under the same name.Fixed Issues
$ #91732
PROPOSAL:
Tests
Offline tests
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, 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.ScrollViewcomponent to make it scrollable when more elements are added to the page.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