From 810301ea237e24b857e4bdc782ad8b6b5423fca1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A1bio=20Henriques?= Date: Tue, 21 Apr 2026 18:01:09 +0100 Subject: [PATCH 1/6] Use newest Onyx changes --- package-lock.json | 8 ++++---- package.json | 2 +- patches/react-native-onyx/details.md | 2 +- ...e-onyx+3.0.63.patch => react-native-onyx+3.0.69.patch} | 0 4 files changed, 6 insertions(+), 6 deletions(-) rename patches/react-native-onyx/{react-native-onyx+3.0.63.patch => react-native-onyx+3.0.69.patch} (100%) diff --git a/package-lock.json b/package-lock.json index 32dd08a59564..be75d4fd2f70 100644 --- a/package-lock.json +++ b/package-lock.json @@ -114,7 +114,7 @@ "react-native-localize": "^3.5.4", "react-native-nitro-modules": "0.35.0", "react-native-nitro-sqlite": "9.6.0", - "react-native-onyx": "3.0.63", + "react-native-onyx": "git+https://github.com/Expensify/react-native-onyx.git#5abe9f855d7ed6d2a72cbe0fea140407e861cee4", "react-native-pager-view": "8.0.0", "react-native-pdf": "7.0.2", "react-native-permissions": "^5.4.0", @@ -34628,9 +34628,9 @@ } }, "node_modules/react-native-onyx": { - "version": "3.0.63", - "resolved": "https://registry.npmjs.org/react-native-onyx/-/react-native-onyx-3.0.63.tgz", - "integrity": "sha512-6UUpjyUh9viXll9M2YomXM9PMg+791foSPA7E0fazgWfrUAmofNwo4xkXT4k3NDdToZFOYxaXL0uw5z00g/MOA==", + "version": "3.0.69", + "resolved": "git+ssh://git@github.com/Expensify/react-native-onyx.git#5abe9f855d7ed6d2a72cbe0fea140407e861cee4", + "integrity": "sha512-Hryp3TEkeX8A0cTPtxmTmD5rz2iPqbBkhQUdQS2SuGf0SA1i4ng7pb3Qw7AeAjqC8U0HkqsW1ea+N5slnv3V8Q==", "license": "MIT", "dependencies": { "ascii-table": "0.0.9", diff --git a/package.json b/package.json index b09d320aa866..9d8a074e3484 100644 --- a/package.json +++ b/package.json @@ -177,7 +177,7 @@ "react-native-localize": "^3.5.4", "react-native-nitro-modules": "0.35.0", "react-native-nitro-sqlite": "9.6.0", - "react-native-onyx": "3.0.63", + "react-native-onyx": "git+https://github.com/Expensify/react-native-onyx.git#5abe9f855d7ed6d2a72cbe0fea140407e861cee4", "react-native-pager-view": "8.0.0", "react-native-pdf": "7.0.2", "react-native-permissions": "^5.4.0", diff --git a/patches/react-native-onyx/details.md b/patches/react-native-onyx/details.md index 67ad7c054e85..b544adfc56b9 100644 --- a/patches/react-native-onyx/details.md +++ b/patches/react-native-onyx/details.md @@ -1,6 +1,6 @@ # `react-native-onyx` patches -### [react-native-onyx+3.0.63.patch](react-native-onyx+3.0.63.patch) +### [react-native-onyx+3.0.69.patch](react-native-onyx+3.0.69.patch) - Reason: Onyx v3.0.59 ([PR #756](https://github.com/Expensify/react-native-onyx/pull/756)) added a state reset inside the `subscribe` callback of `useOnyx` to fix stale data when keys change dynamically. However, this reset runs unconditionally — including on initial mount — which causes `useSyncExternalStore` to see a new snapshot reference after subscription, triggering one extra render per `useOnyx` hook. This patch guards the reset with a `hasMountedRef` flag so it only runs on key-change re-subscriptions, not on initial mount. - E/App issue: https://github.com/Expensify/App/issues/85416 diff --git a/patches/react-native-onyx/react-native-onyx+3.0.63.patch b/patches/react-native-onyx/react-native-onyx+3.0.69.patch similarity index 100% rename from patches/react-native-onyx/react-native-onyx+3.0.63.patch rename to patches/react-native-onyx/react-native-onyx+3.0.69.patch From 9f5a70eb96d20d21dc8f622dbad704949ba248a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A1bio=20Henriques?= Date: Wed, 22 Apr 2026 08:31:56 +0100 Subject: [PATCH 2/6] Use newest Onyx changes --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index be75d4fd2f70..ea5da7c6a892 100644 --- a/package-lock.json +++ b/package-lock.json @@ -114,7 +114,7 @@ "react-native-localize": "^3.5.4", "react-native-nitro-modules": "0.35.0", "react-native-nitro-sqlite": "9.6.0", - "react-native-onyx": "git+https://github.com/Expensify/react-native-onyx.git#5abe9f855d7ed6d2a72cbe0fea140407e861cee4", + "react-native-onyx": "git+https://github.com/Expensify/react-native-onyx.git#863354ea77a4ea99eb6a2740c110a7e988aa0b1c", "react-native-pager-view": "8.0.0", "react-native-pdf": "7.0.2", "react-native-permissions": "^5.4.0", @@ -34629,8 +34629,8 @@ }, "node_modules/react-native-onyx": { "version": "3.0.69", - "resolved": "git+ssh://git@github.com/Expensify/react-native-onyx.git#5abe9f855d7ed6d2a72cbe0fea140407e861cee4", - "integrity": "sha512-Hryp3TEkeX8A0cTPtxmTmD5rz2iPqbBkhQUdQS2SuGf0SA1i4ng7pb3Qw7AeAjqC8U0HkqsW1ea+N5slnv3V8Q==", + "resolved": "git+ssh://git@github.com/Expensify/react-native-onyx.git#863354ea77a4ea99eb6a2740c110a7e988aa0b1c", + "integrity": "sha512-Myi2VhJbjfkfm/ofYDFnHCHIH/jsE2TH1kz6sTSPF5zEnXV5QzpNTa5Bg+DmBHknxndsocQSwZBMeZJR5IzAiQ==", "license": "MIT", "dependencies": { "ascii-table": "0.0.9", diff --git a/package.json b/package.json index 9d8a074e3484..d05513dd9120 100644 --- a/package.json +++ b/package.json @@ -177,7 +177,7 @@ "react-native-localize": "^3.5.4", "react-native-nitro-modules": "0.35.0", "react-native-nitro-sqlite": "9.6.0", - "react-native-onyx": "git+https://github.com/Expensify/react-native-onyx.git#5abe9f855d7ed6d2a72cbe0fea140407e861cee4", + "react-native-onyx": "git+https://github.com/Expensify/react-native-onyx.git#863354ea77a4ea99eb6a2740c110a7e988aa0b1c", "react-native-pager-view": "8.0.0", "react-native-pdf": "7.0.2", "react-native-permissions": "^5.4.0", From 2b579303ae590049dc7abd9174d44837dbb980a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A1bio=20Henriques?= Date: Wed, 22 Apr 2026 09:44:11 +0100 Subject: [PATCH 3/6] Use newest Onyx changes --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index ea5da7c6a892..62eae531c532 100644 --- a/package-lock.json +++ b/package-lock.json @@ -114,7 +114,7 @@ "react-native-localize": "^3.5.4", "react-native-nitro-modules": "0.35.0", "react-native-nitro-sqlite": "9.6.0", - "react-native-onyx": "git+https://github.com/Expensify/react-native-onyx.git#863354ea77a4ea99eb6a2740c110a7e988aa0b1c", + "react-native-onyx": "git+https://github.com/Expensify/react-native-onyx.git#ae77844210aab767619596453a2be9dbc81efc79", "react-native-pager-view": "8.0.0", "react-native-pdf": "7.0.2", "react-native-permissions": "^5.4.0", @@ -34629,8 +34629,8 @@ }, "node_modules/react-native-onyx": { "version": "3.0.69", - "resolved": "git+ssh://git@github.com/Expensify/react-native-onyx.git#863354ea77a4ea99eb6a2740c110a7e988aa0b1c", - "integrity": "sha512-Myi2VhJbjfkfm/ofYDFnHCHIH/jsE2TH1kz6sTSPF5zEnXV5QzpNTa5Bg+DmBHknxndsocQSwZBMeZJR5IzAiQ==", + "resolved": "git+ssh://git@github.com/Expensify/react-native-onyx.git#ae77844210aab767619596453a2be9dbc81efc79", + "integrity": "sha512-EdMZdAB/VkYVfZGHBCSQSvhGjpz2tEUuTlPOl/Eyf58/fJVvRHR2SsyatbZlx2rpy41Vi90Z0loVC4NSKFB89A==", "license": "MIT", "dependencies": { "ascii-table": "0.0.9", diff --git a/package.json b/package.json index d05513dd9120..3463090df2f3 100644 --- a/package.json +++ b/package.json @@ -177,7 +177,7 @@ "react-native-localize": "^3.5.4", "react-native-nitro-modules": "0.35.0", "react-native-nitro-sqlite": "9.6.0", - "react-native-onyx": "git+https://github.com/Expensify/react-native-onyx.git#863354ea77a4ea99eb6a2740c110a7e988aa0b1c", + "react-native-onyx": "git+https://github.com/Expensify/react-native-onyx.git#ae77844210aab767619596453a2be9dbc81efc79", "react-native-pager-view": "8.0.0", "react-native-pdf": "7.0.2", "react-native-permissions": "^5.4.0", From 953edf60ca6f0abf462d279ef7f953653a11a2aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A1bio=20Henriques?= Date: Fri, 24 Apr 2026 14:32:00 +0100 Subject: [PATCH 4/6] Bump Onyx to 3.0.70 --- package-lock.json | 8 ++++---- package.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 509c6ea09eee..f40ecdb4bb66 100644 --- a/package-lock.json +++ b/package-lock.json @@ -115,7 +115,7 @@ "react-native-localize": "^3.5.4", "react-native-nitro-modules": "0.35.0", "react-native-nitro-sqlite": "9.6.0", - "react-native-onyx": "git+https://github.com/Expensify/react-native-onyx.git#ae77844210aab767619596453a2be9dbc81efc79", + "react-native-onyx": "3.0.70", "react-native-pager-view": "8.0.0", "react-native-pdf": "7.0.2", "react-native-permissions": "^5.4.0", @@ -34481,9 +34481,9 @@ } }, "node_modules/react-native-onyx": { - "version": "3.0.69", - "resolved": "git+ssh://git@github.com/Expensify/react-native-onyx.git#ae77844210aab767619596453a2be9dbc81efc79", - "integrity": "sha512-EdMZdAB/VkYVfZGHBCSQSvhGjpz2tEUuTlPOl/Eyf58/fJVvRHR2SsyatbZlx2rpy41Vi90Z0loVC4NSKFB89A==", + "version": "3.0.70", + "resolved": "https://registry.npmjs.org/react-native-onyx/-/react-native-onyx-3.0.70.tgz", + "integrity": "sha512-+16qxi/eT6SvfXZUjWzRJsSI+V0eKUADHqo5t+9bWnvIq65K/gmlDQGe/2Csic2UsQA7dACPpMuAEJdnYV5eCQ==", "license": "MIT", "dependencies": { "ascii-table": "0.0.9", diff --git a/package.json b/package.json index cf4319e42eea..b12789e54d7e 100644 --- a/package.json +++ b/package.json @@ -178,7 +178,7 @@ "react-native-localize": "^3.5.4", "react-native-nitro-modules": "0.35.0", "react-native-nitro-sqlite": "9.6.0", - "react-native-onyx": "git+https://github.com/Expensify/react-native-onyx.git#ae77844210aab767619596453a2be9dbc81efc79", + "react-native-onyx": "3.0.70", "react-native-pager-view": "8.0.0", "react-native-pdf": "7.0.2", "react-native-permissions": "^5.4.0", From ad81f2dd9a87d89d064a0bfba9176c15594445ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A1bio=20Henriques?= Date: Fri, 24 Apr 2026 14:37:54 +0100 Subject: [PATCH 5/6] Update Onyx patch --- patches/react-native-onyx/details.md | 2 +- ...-native-onyx+3.0.69.patch => react-native-onyx+3.0.70.patch} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename patches/react-native-onyx/{react-native-onyx+3.0.69.patch => react-native-onyx+3.0.70.patch} (100%) diff --git a/patches/react-native-onyx/details.md b/patches/react-native-onyx/details.md index b544adfc56b9..08bdbeb96d93 100644 --- a/patches/react-native-onyx/details.md +++ b/patches/react-native-onyx/details.md @@ -1,6 +1,6 @@ # `react-native-onyx` patches -### [react-native-onyx+3.0.69.patch](react-native-onyx+3.0.69.patch) +### [react-native-onyx+3.0.70.patch](react-native-onyx+3.0.70.patch) - Reason: Onyx v3.0.59 ([PR #756](https://github.com/Expensify/react-native-onyx/pull/756)) added a state reset inside the `subscribe` callback of `useOnyx` to fix stale data when keys change dynamically. However, this reset runs unconditionally — including on initial mount — which causes `useSyncExternalStore` to see a new snapshot reference after subscription, triggering one extra render per `useOnyx` hook. This patch guards the reset with a `hasMountedRef` flag so it only runs on key-change re-subscriptions, not on initial mount. - E/App issue: https://github.com/Expensify/App/issues/85416 diff --git a/patches/react-native-onyx/react-native-onyx+3.0.69.patch b/patches/react-native-onyx/react-native-onyx+3.0.70.patch similarity index 100% rename from patches/react-native-onyx/react-native-onyx+3.0.69.patch rename to patches/react-native-onyx/react-native-onyx+3.0.70.patch From 5e0391c63abcc74e66b2d8fe9438040bf172a688 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A1bio=20Henriques?= Date: Tue, 12 May 2026 11:48:55 +0100 Subject: [PATCH 6/6] Bump Onyx to 3.0.71 --- package-lock.json | 8 ++--- package.json | 2 +- patches/react-native-onyx/details.md | 7 ---- .../react-native-onyx+3.0.70.patch | 35 ------------------- 4 files changed, 5 insertions(+), 47 deletions(-) delete mode 100644 patches/react-native-onyx/details.md delete mode 100644 patches/react-native-onyx/react-native-onyx+3.0.70.patch diff --git a/package-lock.json b/package-lock.json index f529120476aa..6575e9d07fcc 100644 --- a/package-lock.json +++ b/package-lock.json @@ -115,7 +115,7 @@ "react-native-localize": "^3.5.4", "react-native-nitro-modules": "0.35.0", "react-native-nitro-sqlite": "9.6.0", - "react-native-onyx": "3.0.70", + "react-native-onyx": "3.0.71", "react-native-pager-view": "8.0.0", "react-native-pdf": "7.0.2", "react-native-permissions": "^5.4.0", @@ -34997,9 +34997,9 @@ } }, "node_modules/react-native-onyx": { - "version": "3.0.70", - "resolved": "https://registry.npmjs.org/react-native-onyx/-/react-native-onyx-3.0.70.tgz", - "integrity": "sha512-+16qxi/eT6SvfXZUjWzRJsSI+V0eKUADHqo5t+9bWnvIq65K/gmlDQGe/2Csic2UsQA7dACPpMuAEJdnYV5eCQ==", + "version": "3.0.71", + "resolved": "https://registry.npmjs.org/react-native-onyx/-/react-native-onyx-3.0.71.tgz", + "integrity": "sha512-q84y7aULjoRtQMjLP7fXYtI0nDROyfCgSKHEgZNHBwSvSogOEbGbsHw9qGm6jFIjIoOJf6Hzd3+FnIrFu+WVEQ==", "license": "MIT", "dependencies": { "ascii-table": "0.0.9", diff --git a/package.json b/package.json index ec994daa5ce2..8b979c905e06 100644 --- a/package.json +++ b/package.json @@ -179,7 +179,7 @@ "react-native-localize": "^3.5.4", "react-native-nitro-modules": "0.35.0", "react-native-nitro-sqlite": "9.6.0", - "react-native-onyx": "3.0.70", + "react-native-onyx": "3.0.71", "react-native-pager-view": "8.0.0", "react-native-pdf": "7.0.2", "react-native-permissions": "^5.4.0", diff --git a/patches/react-native-onyx/details.md b/patches/react-native-onyx/details.md deleted file mode 100644 index 08bdbeb96d93..000000000000 --- a/patches/react-native-onyx/details.md +++ /dev/null @@ -1,7 +0,0 @@ -# `react-native-onyx` patches - -### [react-native-onyx+3.0.70.patch](react-native-onyx+3.0.70.patch) - -- Reason: Onyx v3.0.59 ([PR #756](https://github.com/Expensify/react-native-onyx/pull/756)) added a state reset inside the `subscribe` callback of `useOnyx` to fix stale data when keys change dynamically. However, this reset runs unconditionally — including on initial mount — which causes `useSyncExternalStore` to see a new snapshot reference after subscription, triggering one extra render per `useOnyx` hook. This patch guards the reset with a `hasMountedRef` flag so it only runs on key-change re-subscriptions, not on initial mount. -- E/App issue: https://github.com/Expensify/App/issues/85416 -- Upstream PR/issue: N/A diff --git a/patches/react-native-onyx/react-native-onyx+3.0.70.patch b/patches/react-native-onyx/react-native-onyx+3.0.70.patch deleted file mode 100644 index 7b321b0f51de..000000000000 --- a/patches/react-native-onyx/react-native-onyx+3.0.70.patch +++ /dev/null @@ -1,35 +0,0 @@ -diff --git a/node_modules/react-native-onyx/dist/useOnyx.js b/node_modules/react-native-onyx/dist/useOnyx.js -index b361d0d..4df16fa 100644 ---- a/node_modules/react-native-onyx/dist/useOnyx.js -+++ b/node_modules/react-native-onyx/dist/useOnyx.js -@@ -97,6 +97,9 @@ function useOnyx(key, options, dependencies = []) { - // after cleanup), so the hook automatically enters first-connection mode for the new key without any - // explicit reset logic — eliminating the race condition where cleanup could clobber a boolean flag. - const connectedKeyRef = (0, react_1.useRef)(null); -+ // Tracks whether the hook has completed its initial mount subscription. -+ // Unlike connectedKeyRef (which gets nulled by cleanup), this persists across re-subscriptions. -+ const hasMountedRef = (0, react_1.useRef)(false); - // Indicates if the hook is connecting to an Onyx key. - const isConnectingRef = (0, react_1.useRef)(false); - // Stores the `onStoreChange()` function, which can be used to trigger a `getSnapshot()` update when desired. -@@ -220,11 +223,15 @@ function useOnyx(key, options, dependencies = []) { - const subscribe = (0, react_1.useCallback)((onStoreChange) => { - // Reset internal state so the hook properly transitions through loading - // for the new key instead of preserving stale state from the previous one. -- previousValueRef.current = null; -- newValueRef.current = null; -- shouldGetCachedValueRef.current = true; -- sourceValueRef.current = undefined; -- resultRef.current = [undefined, { status: (options === null || options === void 0 ? void 0 : options.initWithStoredValues) === false ? 'loaded' : 'loading' }]; -+ // Only reset when the key has actually changed (not on initial mount). -+ if (hasMountedRef.current) { -+ previousValueRef.current = null; -+ newValueRef.current = null; -+ shouldGetCachedValueRef.current = true; -+ sourceValueRef.current = undefined; -+ resultRef.current = [undefined, { status: (options === null || options === void 0 ? void 0 : options.initWithStoredValues) === false ? 'loaded' : 'loading' }]; -+ } -+ hasMountedRef.current = true; - isConnectingRef.current = true; - onStoreChangeFnRef.current = onStoreChange; - connectionRef.current = OnyxConnectionManager_1.default.connect({