Skip to content

[Onyx bump] Bump react-native-onyx from 3.0.85 to 3.0.86#94449

Merged
mountiny merged 1 commit into
Expensify:mainfrom
callstack-internal:bump-onyx-3.0.86
Jun 26, 2026
Merged

[Onyx bump] Bump react-native-onyx from 3.0.85 to 3.0.86#94449
mountiny merged 1 commit into
Expensify:mainfrom
callstack-internal:bump-onyx-3.0.86

Conversation

@elirangoshen

@elirangoshen elirangoshen commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Explanation of Change

This PR bumps Onyx from 3.0.85 to 3.0.86 (diff), which includes the following changes:

  • react-native-onyx#792 — Make retried Onyx writes idempotent on storage retry. Two pre-existing bugs in every write path that flows through retryOperation (mergeCollectionWithPatches, multiSetWithRetry, setCollectionWithRetry, partialSetCollection): (1) a brand-new key was silently downgraded from Storage.multiSet to Storage.multiMerge on retry, and (2) keysChanged/keyChanged re-fired on every retry attempt, double-notifying Onyx.connect({waitForCollectionCallback: true}) subscribers (which re-fire on every call by contract). Each write now splits into an outer orchestrator (cache + subscriber notify + storage prep, called once) and a file-private write helper that retryOperation re-enters — so the cache stays consistent and subscribers fire exactly once per logical write. setWithRetry was already safe (broadcastUpdate short-circuits on hasChanged === false).

Fixed Issues

$ #94684
PROPOSAL: N/A — Onyx version bump. The underlying fix (react-native-onyx#792) was a #787 review follow-up with no separate App issue; companion testing PR is Expensify/App#91626.

Tests

The four refactored onyx write paths (mergeCollectionWithPatches, multiSetWithRetry, setCollectionWithRetry, partialSetCollection) are reached from the App via Pusher events, the OpenApp response, every Onyx.update batch that contains a MERGE_COLLECTION / MULTI_SET / SET_COLLECTION op, LHN refresh, Search filters, chat sends, mark-all-as-read, hold/unhold, workspace switching, etc.

Setup

  1. Check out this branch (bump-onyx-3.0.86).
  2. npm install under Node 20.20.0, then npm run web.
  3. Open https://dev.new.expensify.com:8082/ in Chrome with DevTools open.
  4. Sign in to a test account.

Functional smoke — no regression in the refactored paths

The fix preserves the cache-first invariant from #787, so all of these should look indistinguishable from main to the user:

  1. Initial hydration — after login, LHN reports list and workspace switcher populate within a few seconds. No missing rows vs. a baseline session on main. (exercises mergeCollectionWithPatches via Pusher / OpenApp)
  2. Chat message — open a chat, send a message. Appears immediately (optimistic merge into reportActions_), confirms via Pusher, persists after reload. (mergeCollectionWithPatches)
  3. Mark all as read — click the mark-all-as-read action. All unread badges clear immediately and stay cleared after reload. (mergeCollectionWithPatches)
  4. Search & filter — open Search, apply a filter. Results populate within a few seconds; live updates as filters change; no duplicates. (mergeCollectionWithPatches + setCollectionWithRetry)
  5. Hold / unhold an expense — toggle hold on an expense in a report. Badge appears/clears immediately; persists after reload. (mergeCollectionWithPatches)
  6. Submit expense — FAB → Submit expense. Expense appears in the report immediately, no duplicate, persists after reload. (mergeCollectionWithPatches)
  7. Switch workspaces — switch via the workspace switcher. LHN reports filter to the new workspace within a few seconds. (mergeCollectionWithPatches)

Storage-failure simulation — the core regression guard

This is the test that exercises the retry path the fix targets. With the fix in place, retries on storage failure should produce one subscriber notification per logical operation (not one per retry attempt), and brand-new keys should stay routed through multiSet even when an earlier multiMerge retry kicks in.

  1. With the App running and authenticated, open Chrome DevTools → Application tab → IndexedDB.
  2. Find the database used by Onyx (typically named OnyxDB).
  3. Right-click → Delete database while the App is still running and connected (do not reload).
  4. Immediately trigger a mergeCollection-driven action — switch workspaces, send a chat message, or apply a search filter.
  5. Expected with this fix: the UI updates correctly; the new state is visible to subscribers even though the underlying IDB write fails and retryOperation kicks in. Console shows storage error logs and retry attempts (look for Failed to save to storage. Error: ... retryAttempt: N/5), but no white screen, no stale UI, no data loss within the session, and no duplicate waitForCollectionCallback subscriber invocations.
  6. Try the same with a multiSet-driven action and a setCollection-driven action (Search filter result population) to cover the other refactored paths.
  7. (Optional regression check) Revert the bump to 3.0.85 locally and re-run step 4. Without the fix you'll see Onyx.connect({waitForCollectionCallback: true}) callbacks firing twice in DevTools traces.

Cold-cache merge — preserves the pre-warm fast path from #787

  1. Sign out and clear site data to force a cold cache.
  2. Sign back in. LHN should populate within the same window as a baseline main session — the cache pre-warm path (existing in mergeCollectionWithPatches) is untouched by Add hotkey navigation of the chat history in desktop #792.
  • Verify that no errors appear in the JS console

Offline tests

This PR is an Onyx version bump; there is no offline behavior to test that isn't already covered by the existing Onyx offline-first invariants. The fix specifically protects subscribers from going stale when a storage write fails — the user-visible behavior offline is better with this bump (UI reflects the merge even if IDB writes back-pressure), not worse. Spot-check the existing offline path:

  1. Toggle "Offline" in DevTools Network tab.
  2. Send a chat message → appears optimistically.
  3. Toggle back online → message confirms via Pusher.
  4. Verify no white screen, no stale UI.

QA Steps

Same as tests

  • Verify that no errors appear in the JS console

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

N/A — Onyx storage retry path is exercised on web; no native-specific changes.

Android: mWeb Chrome

iOS: Native

N/A — Onyx storage retry path is exercised on web; no native-specific changes.

iOS: mWeb Safari

MacOS: Chrome / Safari

Screen.Recording.2026-05-26.at.14.41.29.mov
Screen.Recording.2026-05-26.at.14.42.06.mov
Screen.Recording.2026-05-26.at.14.42.27.mov
Screen.Recording.2026-05-26.at.14.43.07.mov
Screen.Recording.2026-05-26.at.14.44.17.mov
Screen.Recording.2026-05-26.at.14.44.48.mov

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

⚠️ This PR is possibly changing native code and/or updating libraries, it may cause problems with HybridApp. Please check if any patch updates are required in the HybridApp repo and run an AdHoc build to verify that HybridApp will not break. Ask Contributor Plus for help if you are not sure how to handle this. ⚠️

@elirangoshen elirangoshen marked this pull request as ready for review June 24, 2026 10:53
@elirangoshen elirangoshen requested a review from a team as a code owner June 24, 2026 10:53
@melvin-bot melvin-bot Bot requested review from mollfpr and removed request for a team June 24, 2026 10:54
@melvin-bot

melvin-bot Bot commented Jun 24, 2026

Copy link
Copy Markdown

@mollfpr 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]

@elirangoshen

elirangoshen commented Jun 25, 2026

Copy link
Copy Markdown
Contributor Author

Hi, is there update ? @mollfpr @mountiny

@mountiny mountiny requested review from Krishna2323 and mountiny June 26, 2026 10:45
@Krishna2323

Krishna2323 commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

reviewing...

@Krishna2323

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 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 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 and each prop has a /** comment above it */
    • The file is named correctly
    • 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
    • For Class Components, any internal methods passed to components event handlers are bound to this properly so there are no scoping issues (i.e. for onClick={this.submit} the method this.submit should be bound to this in the constructor)
    • Any internal methods bound to this are necessary to be bound (i.e. avoid this.submit = this.submit.bind(this); if this.submit is never passed to a component event handler like onClick)
    • All JSX used for rendering exists in the render method
    • 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 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 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
android_mWeb.mp4
iOS: HybridApp
iOS: mWeb Safari
ios_mWeb.mp4
MacOS: Chrome / Safari
web_chrome_1.mp4
web_chrome_offline.mp4
web_chrome_2.mp4
web_chrome_3.mp4

@Krishna2323 Krishna2323 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.

Tests well!

@Krishna2323

Copy link
Copy Markdown
Contributor

Setup

  1. Check out this branch (bump-onyx-3.0.86).
  2. npm install under Node 20.20.0, then npm run web.
  3. Open https://dev.new.expensify.com:8082/ in Chrome with DevTools open.
  4. Sign in to a test account.

@elirangoshen, I don't think this setup is required for QA, since this will be tested on staging once it's deployed. It can be removed to avoid confusion.

@mountiny mountiny merged commit 5b3a712 into Expensify:main Jun 26, 2026
46 checks passed
@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.

@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

🚀 Deployed to staging by https://github.com/mountiny in version: 9.4.21-2 🚀

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

@kavimuru

Copy link
Copy Markdown

@elirangoshen @mountiny @mollfpr
I don't think applause can test the following sections:

Storage-failure simulation — the core regression guard
Cold-cache merge — preserves the pre-warm fast path from

Could this PR be verified internally?

@elirangoshen

Copy link
Copy Markdown
Contributor Author

@elirangoshen @mountiny @mollfpr I don't think applause can test the following sections:

Storage-failure simulation — the core regression guard
Cold-cache merge — preserves the pre-warm fast path from

Could this PR be verified internally?

I verified and its all good

@OSBotify

Copy link
Copy Markdown
Contributor

🚀 Deployed to production by https://github.com/mountiny in version: 9.4.21-9 🚀

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

Bundle Size Analysis (Sentry):

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.

5 participants