Skip to content

[No QA] fix: full reconnects on Reconnect/OpenApp with a newer cutoff - #95497

Merged
mountiny merged 15 commits into
Expensify:mainfrom
callstack-internal:fix/record-full-reconnect-time-from-response
Jul 17, 2026
Merged

mountiny merged 15 commits into
Expensify:mainfrom
callstack-internal:fix/record-full-reconnect-time-from-response

Conversation

@adhorodyski

@adhorodyski adhorodyski commented Jul 7, 2026 •

Copy link
Copy Markdown
Contributor

Explanation of Change

The server can ask for a full re-download by sending a cutoff time: "if your last full download happened before X, download everything again." The app records when its last full download happened and compares it against that cutoff.

The problem: the recorded time was computed when the request was built. The response to that same request can deliver a newer cutoff, and on a device clock behind the server the recorded time lands below it. The app then reads itself as stale right after downloading everything and fires extra full reconnects, re-downloading up to several MB.

The fix: a RecordFullReconnectTime middleware records the time from the response instead. On every successful OpenApp/full-ReconnectApp response it writes LAST_FULL_RECONNECT_TIME = max(now, delivered cutoff, held cutoff) into the response's onyxData, placed right before the cutoff entry so the two values are saved together and the app never sees a new cutoff next to an old recorded time. The build-time successData write in App.ts is deleted. Full vs partial ReconnectApp is decided by isFullDownloadRequest, the same rule the queue's reconnect dedup uses.

Fixed Issues

$ #95591
PROPOSAL:

Tests

  1. Run npx jest tests/unit/FullReconnectUtilsTest.ts tests/unit/RecordFullReconnectTimeMiddlewareTest.ts tests/unit/SubscribeToFullReconnectTest.ts.
  2. Verify all 33 tests pass. They cover the helper, the middleware gating, and the end-to-end regressions: a response delivering a newer cutoff, an older one than a held cutoff, or none at all fires zero extra reconnects.

Offline tests

N/A — the behavior is only reachable with a device clock behind the server during a sign-in/clear whose OpenApp response delivers a newer reconnect cutoff; covered by unit tests, no user-visible change otherwise.

QA Steps

Same as tests

PR Author Checklist

  • I linked the correct issue in the ### Fixed Issues section above
  • I wrote clear testing steps that cover the changes made in this PR
    • I added steps for local testing in the Tests section
    • I added steps for the expected offline behavior in the Offline steps section
    • I added steps for Staging and/or Production testing in the QA steps section
    • I added steps to cover failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
    • I tested this PR with a High Traffic account against the staging or production API to ensure there are no regressions (e.g. long loading states that impact usability).
  • I included screenshots or videos for tests on all platforms
  • I ran the tests on all platforms & verified they passed on:
    • Android: Native
    • Android: mWeb Chrome
    • iOS: Native
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • I verified there are no console errors (if there's a console error not related to the PR, report it or open an issue for it to be fixed)
  • I followed proper code patterns (see Reviewing the code)
    • I verified that any callback methods that were added or modified are named for what the method does and never what callback they handle (i.e. toggleReport and not onIconClick)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I followed the guidelines as stated in the Review Guidelines
  • I tested other components that can be impacted by my changes (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar are working as expected)
  • If any new file was added I verified that:
    • The file has a description of what it does and/or why is needed at the top of the file if the code is not self explanatory
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))
  • If new assets were added or existing ones were modified, I verified that:
    • The assets are optimized and compressed (for SVG files, run npm run compress-svg)
    • The assets load correctly across all supported platforms.
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • I added unit tests for any new feature or bug fix in this PR to help automatically prevent regressions in this user flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.

Screenshots/Videos

Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari

…vers

An OpenApp or full-ReconnectApp response can itself deliver a newer
"reconnect if older than X" cutoff than the one known when the request
was built. The reconnect time waiting in the request's successData was
computed from that older cutoff, so on a device whose clock runs behind
the server the app saved a time below the delivered cutoff, read itself
as stale right after downloading everything, and fired two extra full
reconnects (one when the new cutoff was saved next to the old time, one
more when the stale successData lowered the time below the cutoff again).

A new middleware recomputes the time from the cutoff the response
actually carries before the response is applied: it seeds the value into
the response's onyxData right before the cutoff entry (so the two are
saved together and the reconnect subscription never sees a new cutoff
next to an old time) and raises the successData entry in place (never
lowering it) so the later successData write cannot undo the seed.
…rals

The Onyx update entries type their value as any, so reading the cutoff
and recorded time now narrows through typeof checks on an unknown
binding instead of asserting. The middleware test request/response
builders drop their double assertions entirely; every field they set is
part of the declared type.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@codecov

codecov Bot commented Jul 8, 2026 •

Copy link
Copy Markdown

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.

Files with missing lines Coverage Δ
src/libs/API/index.ts 92.52% <100.00%> (+0.07%) ⬆️
src/libs/FullReconnectUtils.ts 100.00% <100.00%> (ø)
src/libs/Middleware/RecordFullReconnectTime.ts 100.00% <100.00%> (ø)
src/libs/actions/App.ts 50.72% <100.00%> (-1.05%) ⬇️
src/libs/actions/RequestConflictUtils.ts 100.00% <100.00%> (ø)
... and 9 files with indirect coverage changes

@adhorodyski adhorodyski changed the title Fix extra full reconnects when an OpenApp/ReconnectApp response delivers a newer reconnect cutoff fix: full reconnects on Reconnect/OpenApp with a newer cutoff Jul 8, 2026
@adhorodyski

Copy link
Copy Markdown
Contributor Author

@codex review

@adhorodyski adhorodyski changed the title fix: full reconnects on Reconnect/OpenApp with a newer cutoff [No QA] fix: full reconnects on Reconnect/OpenApp with a newer cutoff Jul 8, 2026
@adhorodyski

Copy link
Copy Markdown
Contributor Author

I made it [No QA] as I believe it's not possible to repro this by a QA.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Swish!

Reviewed commit: 0e8c6b7af2

ℹ️ 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".

@mountiny

mountiny commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

@MelvinBot review
@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit: 0e8c6b7af2

ℹ️ 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".

@MelvinBot

Copy link
Copy Markdown
Contributor

🤖 Review of the RecordFullReconnectTime middleware.

Verdict: The root cause is correctly diagnosed and the frontend-only approach is reasonable. The steady-state is sound — the recorded time always ends up >= cutoff, so the app can't get stuck in a reconnect loop. My one substantive concern is that the "no extra reconnect fires at all" guarantee leans on an Onyx callback-ordering property that isn't actually guaranteed, and the end-to-end test doesn't exercise the real batching path. Details below.

1. The "splice before the cutoff" safeguard relies on undocumented Onyx callback ordering (main concern)

The fix has two independent safeguards:

  • Raise the successData value so the final persisted LAST_FULL_RECONNECT_TIME >= cutoff — FullReconnectUtils.ts:61-65.
  • Splice a LAST_FULL_RECONNECT_TIME merge before the cutoff entry so the reconnect subscription "never sees a new cutoff next to an old recorded time" — FullReconnectUtils.ts:65.

The first safeguard guarantees eventual consistency (no repeating loop). But it does not prevent a single transient reconnect: subscribeToFullReconnect fires on each key change against module-level vars, so if the cutoff callback runs before the recorded-time callback, it fires a reconnect with the still-stale lastFullReconnectTime.

Preventing that transient trigger is entirely the job of the second safeguard — array ordering. The problem: Onyx.update() runs its per-key operations via Promise.all(...) (concurrent), and each merge only broadcasts after its own get() resolves. Callback firing order is therefore governed by which key's get() microtask resolves first, not by array index. It happens to work here only because both keys are cache-resident (the two connectWithoutView subscriptions populate them at startup), so their get()s resolve as microtasks in array order. If either key ever required a storage read, the ordering — and the guarantee — would flip.

This is fine in practice today, but it's load-bearing behavior resting on an incidental property of the Onyx internals. Suggestions, in order of preference: (a) at minimum, add a comment in recordFullReconnectTimeFromResponse stating the splice-ordering correctness depends on both keys being cache-resident; (b) better, make the subscription robust to observing the two keys transiently out of sync (e.g. re-read both from Onyx before triggering) so correctness doesn't depend on write ordering at all.

2. The end-to-end regression test doesn't reproduce the real WRITE batching

For WRITE requests (OpenApp and full ReconnectApp), the real pipeline concatenates response.onyxData and request.successData into a single Onyx.update(...) call (queueOnyxUpdates → flushQueue in QueuedOnyxUpdates.ts), not two separate calls. But applyCapturedResponseThroughMiddleware applies them as two sequential Onyx.update calls with waitForBatchedUpdates() in between.

Two separate awaited updates give the recorded-time write its own settled broadcast before the cutoff/successData ever land together — which is exactly the concurrency race from point 1 that the single combined update is subject to but this test isn't. So the test can pass while being more forgiving than production. (This mirrors the pre-existing applyServerResponse/applyCapturedResponse helpers, so it's a harness convention rather than something new — but it's worth a test that drives one combined Onyx.update([...onyxData, ...successData]) to actually exercise the batched path.)

3. Minor
  • Type casts: the middleware casts response.onyxData as AnyOnyxUpdate[] and request.successData as AnyOnyxUpdate[] | undefined (RecordFullReconnectTime.ts:23). These bypass the generic OnyxUpdate<TKey> typing; harmless here since the helper only reads .key/.value, but a type change to those fields would slip past the compiler.
  • Empty delivered cutoff: if a response delivers the cutoff key with an empty value (clearing it), cutoffIndex !== -1 still passes and getLastFullReconnectTimeToRecord('') records now, so a LAST_FULL_RECONNECT_TIME entry is seeded even though there's no cutoff to satisfy. Not harmful (never lowers), just slightly more writing than needed — worth a quick confirm that's intended.
  • The command guard correctly matches every ReconnectApp because the WRITE and side-effect variants share the string value 'ReconnectApp', and partial ReconnectApps are safely no-ops (no LAST_FULL_RECONNECT_TIME in their successData). 👍

Nice, tightly-scoped fix with good test coverage of the helper itself — the two points above are about hardening the guarantee, not correctness of the happy path.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 fixes a regression where an OpenApp/ReconnectApp response can deliver a newer “full reconnect cutoff” than was known at request build time, causing the app to record a stale LAST_FULL_RECONNECT_TIME and trigger redundant full reconnects (extra multi‑MB downloads). The solution adds a small middleware that rewrites the reconnect time based on the cutoff actually delivered in the response, ensuring Onyx never briefly observes a new cutoff alongside an old recorded time.

Changes:

  • Added recordFullReconnectTimeFromResponse() to recompute and seed LAST_FULL_RECONNECT_TIME into both response.onyxData (before the cutoff update) and the request successData.
  • Introduced RecordFullReconnectTime middleware and registered it before SaveResponseInOnyx.
  • Added unit tests covering the helper, middleware gating, and an end-to-end regression scenario (newer cutoff delivered by OpenApp response).

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/unit/SubscribeToFullReconnectTest.ts Adds an end-to-end regression test ensuring no extra reconnect occurs when OpenApp response delivers a newer cutoff.
tests/unit/RecordFullReconnectTimeMiddlewareTest.ts New unit tests for middleware behavior (eligible commands, success-only, passthrough).
tests/unit/FullReconnectUtilsTest.ts Adds coverage for recordFullReconnectTimeFromResponse() including “never lower” behavior.
src/libs/Middleware/RecordFullReconnectTime.ts New middleware that adjusts reconnect time using the response-delivered cutoff before Onyx updates apply.
src/libs/Middleware/index.ts Exports the new middleware.
src/libs/FullReconnectUtils.ts Implements recordFullReconnectTimeFromResponse() to seed consistent reconnect time updates.
src/libs/API/index.ts Registers RecordFullReconnectTime middleware before SaveResponseInOnyx.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/libs/API/index.ts Resolved
…e apply path

Review follow-up: document that the splice-before-cutoff ordering rests on
Onyx broadcasting a batch's merges in array order (with the bounded worst
case if that flips), correct the stale "LAST middleware" comment that
FraudMonitoring already contradicts, and add a regression test that applies
the newer-cutoff OpenApp response the way WRITE requests actually land in
production — one combined Onyx.update via QueuedOnyxUpdates.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@adhorodyski

Copy link
Copy Markdown
Contributor Author

Addressed the review feedback in 035ff77:

1. Ordering assumption (main concern) — documented on recordFullReconnectTimeFromResponse: the splice-ordering guarantee rests on both keys being cache-resident, it's pinned by the e2e test (so an Onyx upgrade that flips broadcast ordering fails CI rather than silently degrading), and the worst case if it ever flips is one transient extra reconnect, never a loop. We also looked hard at making the subscription robust instead and rejected both shapes of it: re-reading the keys before triggering is a no-op (the Onyx cache genuinely holds new cutoff + old time at that instant, so a fresh read returns the same transient state), and a microtask-deferred check swaps a documented array-ordering assumption for an undocumented microtask-depth one — while being unable to span the legacy side-effect ReconnectApp path, where onyxData and successData apply as two fully-settled Onyx.update calls and the splice is the deterministic fix, not race insurance.

2. Test doesn't exercise the batched path — agreed, with one refinement: both apply shapes are real production paths (applyHTTPSOnyxUpdates routes WRITE commands through queueOnyxUpdates → one combined Onyx.update at flush; the side-effect ReconnectApp applies two sequential updates). So instead of replacing the sequential helper, the new test drives the newer-cutoff OpenApp scenario through the real queueOnyxUpdates/flushQueue functions, exercising the combined batch where the spliced entry and the successData entry meet in one Onyx.update. Verified it fails without the middleware transform.

3a. Type casts — keeping them: the casts only erase the generic key parameter, and the typeof guards inside the helper are the actual safety boundary for .value; a cast-free version forces the generics through the middleware signature for no added safety.

3b. Empty delivered cutoff — intended: a 200 OpenApp/full-ReconnectApp response means a full download just happened, so recording now is accurate whatever the cutoff's value, and it never lowers an existing time.

@adhorodyski
adhorodyski marked this pull request as ready for review July 10, 2026 14:38
@adhorodyski
adhorodyski requested review from a team as code owners July 10, 2026 14:38
@melvin-bot
melvin-bot Bot requested review from bernhardoj and heyjennahay and removed request for a team July 10, 2026 14:38
@melvin-bot

melvin-bot Bot commented Jul 10, 2026

Copy link
Copy Markdown

@bernhardoj Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button]

@melvin-bot
melvin-bot Bot removed the request for review from a team July 10, 2026 14:38
@bernhardoj

Copy link
Copy Markdown
Contributor

If I understand correctly, the issue happens because we compute the last reconnect time before making the requests. We did it twice.

App/src/libs/actions/App.ts

Lines 555 to 557 in 5ee0283

function triggerFullReconnect(cutoff: string) {
Onyx.merge(ONYXKEYS.LAST_FULL_RECONNECT_TIME, getLastFullReconnectTimeToRecord(cutoff)).then(() => reconnectApp());
}

Even though we set it to successData, it's computed when building the successData.

App/src/libs/actions/App.ts

Lines 396 to 403 in 5ee0283

if (isOpenApp || isFullReconnect) {
// Record this reconnect so subscribeToFullReconnect stops asking for another one.
result.successData?.push({
onyxMethod: Onyx.METHOD.MERGE,
key: ONYXKEYS.LAST_FULL_RECONNECT_TIME,
value: getLastFullReconnectTimeToRecord(serverReconnectCutoff),
});
}

So, we compute it in the middleware after the response is finished. Is it possible to remove both getLastFullReconnectTimeToRecord from the above?

I was thinking maybe we can update recordFullReconnectTimeFromResponse to be like this:

function recordFullReconnectTimeFromResponse(responseOnyxData: AnyOnyxUpdate[]): void {
    const cutoff = responseOnyxData.find((update) => update.key === ONYXKEYS.NVP_RECONNECT_APP_IF_FULL_RECONNECT_BEFORE)?.value;
    const deliveredCutoff = typeof cutoff === 'string' ? cutoff : '';
    // if server response doesn't have NVP_RECONNECT_APP_IF_FULL_RECONNECT_BEFORE, then we will use the current time
    const timeForDeliveredCutoff = getLastFullReconnectTimeToRecord(deliveredCutoff);
    // since we don't have the success data anymore, we can simply push this
    responseOnyxData.push({onyxMethod: Onyx.METHOD.MERGE, key: ONYXKEYS.LAST_FULL_RECONNECT_TIME, value: timeForDeliveredCutoff});
}

and adjust the recordFullReconnectTime middleware (check whether the request is a full reconnect or not, we can check the updateIDFrom param, allow an empty response to pass, and probably allow a failed request to pass). Wdyt?

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

This PR adds a new Onyx.connectWithoutView call, so I've requested a review from the Onyx performance reviewers (@tgolen, @mountiny, @luacmartins) — a review from any one of them is enough. Please add a link in your PR description to the Slack discussion where the @frontend-performance team approved using connectWithoutView here.

@adhorodyski

adhorodyski commented Jul 15, 2026 •

Copy link
Copy Markdown
Contributor Author

@bernhardoj I took your shape: the successData entry is gone from App.ts, and the middleware is the only writer of LAST_FULL_RECONNECT_TIME on a successful full download. You were right on all three points, so the never-lower rule, its test, and the successData marker are deleted.

Two additions were needed to make it hold everywhere:

1. The recorded time is clamped to the cutoff the client already holds, not just the delivered one: max(now, delivered cutoff, held cutoff). This fixes your mid-flight case directly (a Pusher cutoff overtaking the response can no longer be undercut) and a second one: a success response that delivers no cutoff, where recording plain client-now on a behind clock would drop below the held cutoff and loop. The connectWithoutView that App.ts held for this moved into FullReconnectUtils, read via getServerReconnectCutoff().

2. The full-vs-partial rule is shared with the queue. The middleware gates on isFullDownloadRequest in RequestConflictUtils, the same rule the reconnect dedup already used, so the two can't drift apart.

As we deploy this, a request persisted before this version replays with the old build-time value in its successData and can cost one extra reconnect, it self heals though and continues working ok.

adhorodyski and others added 3 commits July 15, 2026 20:47
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Comment thread src/libs/FullReconnectUtils.ts Resolved
@bernhardoj

bernhardoj commented Jul 16, 2026 •

Copy link
Copy Markdown
Contributor

Reviewer Checklist

  • I have verified the author checklist is complete (all boxes are checked off).
  • I verified the correct issue is linked in the ### Fixed Issues section above
  • I verified testing steps are clear and they cover the changes made in this PR
    • I verified the steps for local testing are in the Tests section
    • I verified the steps for Staging and/or Production testing are in the QA steps section
    • I verified the steps cover any possible failure scenarios (i.e. verify an input displays the correct error message if the entered data is not correct)
    • I turned off my network connection and tested it while offline to ensure it matches the expected behavior (i.e. verify the default avatar icon is displayed if app is offline)
  • I checked that screenshots or videos are included for tests on all platforms
  • I included screenshots or videos for tests on all platforms
  • I verified that the composer does not automatically focus or open the keyboard on mobile unless explicitly intended. This includes checking that returning the app from the background does not unexpectedly open the keyboard.
  • I verified tests pass on all platforms & I tested again on:
    • Android: HybridApp
    • Android: mWeb Chrome
    • iOS: HybridApp
    • iOS: mWeb Safari
    • MacOS: Chrome / Safari
  • If there are any errors in the console that are unrelated to this PR, I either fixed them (preferred) or linked to where I reported them in Slack
  • I verified proper code patterns were followed (see Reviewing the code)
    • I verified that comments were added to code that is not self explanatory
    • I verified that any new or modified comments were clear, correct English, and explained "why" the code was doing something instead of only explaining "what" the code was doing.
    • I verified any copy / text that was added to the app is grammatically correct in English. It adheres to proper capitalization guidelines (note: only the first word of header/labels should be capitalized), and is either coming verbatim from figma or has been approved by marketing (in order to get marketing approval, ask the Bug Zero team member to add the Waiting for copy label to the issue)
  • If a new code pattern is added I verified it was agreed to be used by multiple Expensify engineers
  • I verified that this PR follows the guidelines as stated in the Review Guidelines
  • I verified other components that can be impacted by these changes have been tested, and I retested again (i.e. if the PR modifies a shared library or component like Avatar, I verified the components using Avatar have been tested & I retested again)
  • If a new component is created I verified that:
    • A similar component doesn't exist in the codebase
    • All props are defined accurately
    • The component has a clear name that is non-ambiguous and the purpose of the component can be inferred from the name alone
    • The only data being stored in the state is data necessary for rendering and nothing else
    • The component has the minimum amount of code necessary for its purpose, and it is broken down into smaller components in order to separate concerns and functions
  • If a new CSS style is added I verified that:
    • A similar style doesn't already exist
    • The style can't be created with an existing StyleUtils function (i.e. StyleUtils.getBackgroundAndBorderStyle(theme.componentBG)
  • If the PR modifies code that runs when editing or sending messages, I tested and verified there is no unexpected behavior for all supported markdown - URLs, single line code, code blocks, quotes, headings, bold, strikethrough, and italic.
  • If the PR modifies a generic component, I tested and verified that those changes do not break usages of that component in the rest of the App (i.e. if a shared library or component like Avatar is modified, I verified that Avatar is working as expected in all cases)
  • If the PR modifies a component related to any of the existing Storybook stories, I tested and verified all stories for that component are still working as expected.
  • If the PR modifies a component or page that can be accessed by a direct deeplink, I verified that the code functions as expected when the deeplink is used - from a logged in and logged out account.
  • If the PR modifies the UI (e.g. new buttons, new UI components, changing the padding/spacing/sizing, moving components, etc) or modifies the form input styles:
    • I verified that all the inputs inside a form are aligned with each other.
    • I added Design label and/or tagged @Expensify/design so the design team can review the changes.
  • For any bug fix or new feature in this PR, I verified that sufficient unit tests are included to prevent regressions in this flow.
  • If the main branch was merged into this PR after a review, I tested again and verified the outcome was still expected according to the Test steps.
  • I have checked off every checkbox in the PR reviewer checklist, including those that don't apply to this PR.

Screenshots/Videos

Android: HybridApp
Android: mWeb Chrome
iOS: HybridApp
iOS: mWeb Safari
MacOS: Chrome / Safari
w.mp4

@bernhardoj bernhardoj left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@adhorodyski
adhorodyski requested a review from tgolen July 16, 2026 07:03
adhorodyski and others added 2 commits July 16, 2026 16:23
@mountiny
mountiny merged commit 572e9a7 into Expensify:main Jul 17, 2026
35 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

🚧 mountiny has triggered a test Expensify/App build. You can view the workflow run here.

@OSBotify

Copy link
Copy Markdown
Contributor

✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release.

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to staging by https://github.com/mountiny in version: 9.4.41-0 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

@MelvinBot

Copy link
Copy Markdown
Contributor

🤖 I reviewed this PR against the help site content under App/docs/articles and no help site changes are required.

Why: This is a purely internal networking/sync fix. It changes when the app records its "last full reconnect time" — moving that write from request-build time into a new RecordFullReconnectTime middleware that records it from the response (max(now, delivered cutoff, held cutoff)), which stops spurious full re-downloads on devices whose clock is behind the server. The changed files are all internal plumbing (API/index.ts, FullReconnectUtils.ts, Middleware/*, actions/App.ts, RequestConflictUtils.ts, and unit tests).

The PR is labeled [No QA] and explicitly notes there is "no user-visible change otherwise." None of this maps to any customer-facing feature, setting, tab, button, workspace, billing, or integration behavior that the help site documents, so there is nothing to add or correct in the articles.

Since no changes are needed, I did not create a draft help site PR.

@adhorodyski, please confirm you agree that no help site updates are required for this change. If you believe an article should be updated, let me know which behavior it should reflect and I'll create the draft PR.

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/yuwenmemon in version: 9.4.41-4 🚀

platform result
🕸 web 🕸 success ✅
🤖 android 🤖 success ✅
🍎 iOS 🍎 success ✅

Bundle Size Analysis (Sentry):

Comment on lines +62 to +66
* The entry goes right before the delivered cutoff entry, so the reconnect subscription never sees
* a new cutoff next to an old reconnect time. That assumes Onyx broadcasts a batch's merges in
* array order: true today because both keys are cache-resident (see subscribeToFullReconnect.ts),
* and pinned by the SubscribeToFullReconnect e2e test. If it ever broke, the worst case is one
* transient extra reconnect, never a loop.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If it ever broke, the worst case is one transient extra reconnect, never a loop.

The extra reconnect caused a visible UI issue, fixed by PR #100547.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants