Repository navigation
Conversation
Contributor
|
|
LukasMod
force-pushed
the
feat/onyx-get-async-mutable
branch
3 times, most recently
from
September 24, 2026 09:34
02c7b44 to
f27fb19
Compare
tgolen
requested changes
Sep 24, 2026
Contributor
Author
|
I’ll keep it as a draft until the Onyx change is merged and we can properly bump the Onyx version here |
42 tasks done
tgolen
requested changes
Sep 25, 2026
This was referenced Oct 5, 2026
LukasMod
force-pushed
the
feat/onyx-get-async-mutable
branch
from
October 8, 2026 06:54
72e9d18 to
a8691eb
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Explanation of Change
rulesdir/no-unsafe-onyx-read, on repo-wide. It allowsOnyx.getonly undersrc/components,src/pages,src/hooksandtests, and refuses it during render, at module scope, inside code an effect runs, on a Search snapshot key, and on any key lint cannot resolve. When ESLint loads it, the rule readsSEARCH_SNAPSHOT_ONYX_KEYSout ofsrc/CONST/runtimeConfigured.tsand throws if that list ever moves, so the snapshot check fails closed instead of switching itself off.scripts/onyxConnectBypass.tsnow owns two bans instead of one. An inlineeslint-disableof the new rule fails the lint run the same way one ofOnyx.connect()does, andscripts/checkOnyxConnectBypass.tsdrives both checks from the lint pipeline. It carries one grandfathered allowance forsrc/setup/addUtilsToWindow.ts.ONYX-DATA-MANAGEMENT.mdlistsOnyx.get()as a third read path next touseOnyxandOnyx.connectWithoutView, with five rules and a pointer to the lint rule and ONYX-1.react-native-onyxmoves from3.0.111tob3c781503af(3.0.115), whereOnyx.get(key)is public and typedPromise<OnyxValue<TKey>>, with no readonly wrapper on the result. No app code reads with it: no newOnyx.getcall site appears anywhere insrc.Onyx.get.addUtilsToWindow.tsused aconnectWithoutViewshim andreact-native-onyx.d.tsdeclared it onWindow, both only because the library had noget. Deleting the shim and that one declaration line is the whole source change, 21 lines removed.window.Onyx.get,Onyx.log,window.reportand friends now go through the library method, and the call sites in that file are untouched.The grandfathered allowance for
src/setup/addUtilsToWindow.tsin the bypass guard is unused today, since the console helper'swindow.Onyx.getcalls are not the bareOnyx.getthe rule watches. It would tolerate one future bypass in that file, which buys the follow-up work a file that can disable the rule without a new guard change.Rule logic and bypass detection are automated:
tests/unit/NoUnsafeOnyxReadRuleTest.ts(154 cases) andtests/unit/OnyxConnectBypassTest.ts(25 cases) both pass. So doesnpm run typecheck, the 15 Onyx suites intests/unit(336 tests), all oftests/actions(2474 tests), and a fullnpm run lint. The manual steps cover what those cannot reach: the rule against the real source tree, its wiring through the flat config and the lint pipeline, and the dev console helpers on the realOnyx.get.react native onyx PR: Expensify/react-native-onyx#850
Fixed Issues
$ #101910
PROPOSAL:
Tests
Offline tests
QA Steps
Test 1: Smoke test after the Onyx bump
Test 2: Dev console helpers
Prerequisite: a non-production (dev) build, with the browser console open.
await Onyx.get('session')and confirm it returns the session object.Onyx.log('session')and confirm the session is logged.PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectioncanBeMissingparam foruseOnyxtoggleReportand 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
Screen.Recording.2026-09-24.at.11.08.10.mov