Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
44aa890
add ramOnlyKeys param to Onyx.init, remove initWithStoredValues
JKobrynski Feb 12, 2026
4436a4f
remove initWithStoredValues: true
JKobrynski Feb 12, 2026
8b95a3a
Merge branch 'main' into JKobrynski/feat/80091-migrate-keys-to-ram-on…
JKobrynski Feb 13, 2026
fe16418
add onyx migration for ram-only keys
JKobrynski Feb 13, 2026
b58c765
revert accidental Mobile-Expensify submodule pointer change
JKobrynski Feb 14, 2026
6844562
fix canBeMissing for IS_SEARCHING_FOR_REPORTS to true
JKobrynski Feb 14, 2026
de91bc0
Merge branch 'main' into JKobrynski/feat/80091-migrate-keys-to-ram-on…
JKobrynski Feb 16, 2026
d4c0ac6
fix typo in migration log message
JKobrynski Feb 16, 2026
626d598
address review comments
JKobrynski Feb 16, 2026
93bd301
Merge remote-tracking branch 'origin/main' into JKobrynski/feat/80091…
JKobrynski Feb 17, 2026
4a8d2dc
Merge branch 'main' into JKobrynski/feat/80091-migrate-keys-to-ram-on…
JKobrynski Mar 2, 2026
2ce3734
remove ram-only onyx migration
JKobrynski Mar 2, 2026
97a936f
Merge branch 'main' into JKobrynski/feat/80091-migrate-keys-to-ram-on…
JKobrynski Mar 2, 2026
d6f1594
Merge remote-tracking branch 'upstream/main' into JKobrynski/feat/800…
JKobrynski Mar 2, 2026
7370001
remove initWithStoredValues from remaining IS_SEARCHING_FOR_REPORTS
JKobrynski Mar 3, 2026
5666ab1
Merge branch 'main' into JKobrynski/feat/80091-migrate-keys-to-ram-on…
JKobrynski Mar 3, 2026
5f9fcbd
add RAM_ONLY_ prefix to RAM-only keys
JKobrynski Mar 3, 2026
e74b1a5
Merge remote-tracking branch 'upstream/main' into JKobrynski/feat/800…
JKobrynski Mar 3, 2026
01634ee
fix failing test, add explanation
JKobrynski Mar 4, 2026
bb51ecb
Merge remote-tracking branch 'origin/main' into JKobrynski/feat/80091…
JKobrynski Mar 6, 2026
9bb37d2
fix race condition
JKobrynski Mar 9, 2026
c9a31c1
Merge remote-tracking branch 'origin/main' into JKobrynski/feat/80091…
JKobrynski Mar 10, 2026
b705408
Merge remote-tracking branch 'origin/main' into JKobrynski/feat/80091…
JKobrynski Mar 10, 2026
d2d2d67
apply fix suggested by reviewer
JKobrynski Mar 12, 2026
f68144f
handle rejected Linking.getInitialUrl, add timeout
JKobrynski Mar 12, 2026
be3f346
add a stale closure guard
JKobrynski Mar 12, 2026
1d287dd
add more documentation to the safety-net
JKobrynski Mar 12, 2026
4e9b00c
Merge remote-tracking branch 'origin/main' into JKobrynski/feat/80091…
JKobrynski Mar 12, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/CONST/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1743,6 +1743,7 @@ const CONST = {
SHOW_HOVER_PREVIEW_DELAY: 270,
SHOW_HOVER_PREVIEW_ANIMATION_DURATION: 250,
ACTIVITY_INDICATOR_TIMEOUT: 10000,
GET_INITIAL_URL_TIMEOUT: 10000,
MIN_SMOOTH_SCROLL_EVENT_THROTTLE: 16,
},
TELEMETRY: {
Expand Down
76 changes: 62 additions & 14 deletions src/DeepLinkHandler.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ type DeepLinkHandlerProps = {
*/
function DeepLinkHandler({onInitialUrl}: DeepLinkHandlerProps) {
const linkingChangeListener = useRef<NativeEventSubscription | null>(null);
const initialUrlProcessed = useRef(false);

const [allReports] = useOnyx(ONYXKEYS.COLLECTION.REPORT);
const [, sessionMetadata] = useOnyx(ONYXKEYS.SESSION);
Expand All @@ -36,24 +37,57 @@ function DeepLinkHandler({onInitialUrl}: DeepLinkHandlerProps) {
if (isLoadingOnyxValue(sessionMetadata)) {
return;
}
// If the app is opened from a deep link, get the reportID (if exists) from the deep link and navigate to the chat report
Linking.getInitialURL().then((url) => {
onInitialUrl(url as Route);

if (url) {
if (conciergeReportID === undefined) {
Log.info('[Deep link] conciergeReportID is undefined when processing initial URL', false, {url});
// Guard against stale closures: when deps change and the effect re-runs, the previous
// getInitialURL() promise may still be in-flight. Without this guard, its .then() would
// fire with stale conciergeReportID/introSelected values, causing a duplicate
// openReportFromDeepLink() call.
let cancelled = false;

// If the app is opened from a deep link, get the reportID (if exists) from the deep link and navigate to the chat report.
// We race against a timeout to prevent permanently blocking NavigationRoot if getInitialURL() never resolves
// (e.g. in HybridApp when OldDot fails to send the URL via native bridge).
Promise.race([
Linking.getInitialURL(),
new Promise<null>((resolve) => {
setTimeout(() => resolve(null), CONST.TIMING.GET_INITIAL_URL_TIMEOUT);
}),
Comment on lines +50 to +54

Choose a reason for hiding this comment

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

P2 Badge Handle late getInitialURL resolution after timeout

Racing Linking.getInitialURL() against a 10s null timeout unblocks startup, but it also permanently drops deep links when the native bridge returns the initial URL after that timeout (a case this comment already calls out in HybridApp). Once the timeout wins, onInitialUrl(null) runs and the eventual URL resolution is ignored, so users can land on the default route instead of the intended deep-linked report on slower/lagging startup paths.

Useful? React with 👍 / 👎.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Krishna2323 do you have any thoughts on this ☝️ ?

])
.then((url) => {
if (cancelled) {
return;
}
if (introSelected === undefined) {
Log.info('[Deep link] introSelected is undefined when processing initial URL', false, {url});

initialUrlProcessed.current = true;
onInitialUrl(url as Route);

if (url) {
if (conciergeReportID === undefined) {
Log.info('[Deep link] conciergeReportID is undefined when processing initial URL', false, {url});
}
if (introSelected === undefined) {
Log.info('[Deep link] introSelected is undefined when processing initial URL', false, {url});
}
// Use hasAuthToken() for the latest auth state at call time, since the isAuthenticated
// closure value may be stale on cold start (useOnyx reports 'loaded' before storage completes).
const isCurrentlyAuthenticated = hasAuthToken();
openReportFromDeepLink(url, allReports, isCurrentlyAuthenticated, conciergeReportID, introSelected);
} else {
Report.doneCheckingPublicRoom();
}
openReportFromDeepLink(url, allReports, isAuthenticated, conciergeReportID, introSelected);
} else {
Report.doneCheckingPublicRoom();
}

endSpan(CONST.TELEMETRY.SPAN_BOOTSPLASH.DEEP_LINK);
});
endSpan(CONST.TELEMETRY.SPAN_BOOTSPLASH.DEEP_LINK);
})
.catch(() => {
if (cancelled) {
return;
}

initialUrlProcessed.current = true;
onInitialUrl(null);
Report.doneCheckingPublicRoom();
endSpan(CONST.TELEMETRY.SPAN_BOOTSPLASH.DEEP_LINK);
});

// Open chat report from a deep link (only mobile native)
linkingChangeListener.current = Linking.addEventListener('url', (state) => {
Expand All @@ -68,11 +102,25 @@ function DeepLinkHandler({onInitialUrl}: DeepLinkHandlerProps) {
});

return () => {
cancelled = true;
linkingChangeListener.current?.remove();
};
// eslint-disable-next-line react-hooks/exhaustive-deps -- we only want this effect to re-run when conciergeReportID changes
}, [sessionMetadata?.status, conciergeReportID, introSelected]);

// Safety net: if getInitialURL() resolves before the session loads, hasAuthToken() may return false
// for an authenticated user, causing openReportFromDeepLink to take the wrong path. Once isAuthenticated
// settles to true, unblock the UI. The initialUrlProcessed guard ensures this doesn't fire before URL
// resolution. In the common case (isAuthenticated settles first), this is a no-op because
// openReportFromDeepLink's own doneCheckingPublicRoom() call handles it.
useEffect(() => {
if (!isAuthenticated || !initialUrlProcessed.current) {
return;
}

Report.doneCheckingPublicRoom();
}, [isAuthenticated]);

return null;
}

Expand Down
10 changes: 5 additions & 5 deletions src/Expensify.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,9 +65,9 @@ function Expensify() {
const {preferredLocale} = useLocalize();
const [accountID] = useOnyx(ONYXKEYS.SESSION, {selector: accountIDSelector});
const [lastRoute] = useOnyx(ONYXKEYS.LAST_ROUTE);
const [isCheckingPublicRoom = true] = useOnyx(ONYXKEYS.IS_CHECKING_PUBLIC_ROOM, {initWithStoredValues: false});
const [updateAvailable] = useOnyx(ONYXKEYS.UPDATE_AVAILABLE, {initWithStoredValues: false});
const [updateRequired] = useOnyx(ONYXKEYS.UPDATE_REQUIRED, {initWithStoredValues: false});
const [isCheckingPublicRoom = true] = useOnyx(ONYXKEYS.RAM_ONLY_IS_CHECKING_PUBLIC_ROOM);
const [updateAvailable] = useOnyx(ONYXKEYS.RAM_ONLY_UPDATE_AVAILABLE);
const [updateRequired] = useOnyx(ONYXKEYS.RAM_ONLY_UPDATE_REQUIRED);
const [lastVisitedPath] = useOnyx(ONYXKEYS.LAST_VISITED_PATH);

useDebugShortcut();
Expand All @@ -81,7 +81,7 @@ function Expensify() {

const bootsplashSpan = useRef<Sentry.Span>(null);

const [initialUrl, setInitialUrl] = useState<Route | null>(null);
const [initialUrl, setInitialUrl] = useState<Route | null | undefined>(undefined);
const {setIsAuthenticatedAtStartup} = useInitialURLActions();

useEffect(() => {
Expand Down Expand Up @@ -302,7 +302,7 @@ function Expensify() {
<FullstoryInitHandler />
<DeepLinkHandler onInitialUrl={setInitialUrl} />
<AppleAuthWrapper />
{hasAttemptedToOpenPublicRoom && (
{hasAttemptedToOpenPublicRoom && initialUrl !== undefined && (
<NavigationRoot
onReady={setNavigationReady}
authenticated={isAuthenticated}
Expand Down
20 changes: 10 additions & 10 deletions src/ONYXKEYS.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const ONYXKEYS = {
IS_SIDEBAR_LOADED: 'isSidebarLoaded',

/** Boolean flag set whenever we are searching for reports in the server */
IS_SEARCHING_FOR_REPORTS: 'isSearchingForReports',
RAM_ONLY_IS_SEARCHING_FOR_REPORTS: 'isSearchingForReports',

/** Note: These are Persisted Requests - not all requests in the main queue as the key name might lead one to believe */
PERSISTED_REQUESTS: 'networkRequestQueue',
Expand Down Expand Up @@ -103,7 +103,7 @@ const ONYXKEYS = {
CURRENCY_LIST: 'currencyList',

/** Indicates whether an update is available and ready to be installed. */
UPDATE_AVAILABLE: 'updateAvailable',
RAM_ONLY_UPDATE_AVAILABLE: 'updateAvailable',

/** Indicates that a request to join a screen share with a GuidesPlus agent was received */
SCREEN_SHARE_REQUEST: 'screenShareRequest',
Expand Down Expand Up @@ -324,7 +324,7 @@ const ONYXKEYS = {
USER_METADATA: 'userMetadata',

/** Object containing Onfido SDK Token + applicantID */
WALLET_ONFIDO: 'walletOnfido',
RAM_ONLY_WALLET_ONFIDO: 'walletOnfido',

/** Stores information about additional details form entry */
WALLET_ADDITIONAL_DETAILS: 'walletAdditionalDetails',
Expand Down Expand Up @@ -402,7 +402,7 @@ const ONYXKEYS = {
IS_BETA: 'isBeta',

/** Whether we're checking if the room is public or not */
IS_CHECKING_PUBLIC_ROOM: 'isCheckingPublicRoom',
RAM_ONLY_IS_CHECKING_PUBLIC_ROOM: 'isCheckingPublicRoom',

/** A map of the user's security group IDs they belong to in specific domains */
MY_DOMAIN_SECURITY_GROUPS: 'myDomainSecurityGroups',
Expand Down Expand Up @@ -463,7 +463,7 @@ const ONYXKEYS = {
RECENTLY_USED_REPORT_FIELDS: 'recentlyUsedReportFields',

/** Indicates whether an forced upgrade is required */
UPDATE_REQUIRED: 'updateRequired',
RAM_ONLY_UPDATE_REQUIRED: 'updateRequired',

/** Indicates a global supportal permission denial that should surface a modal */
SUPPORTAL_PERMISSION_DENIED: 'supportalPermissionDenied',
Expand Down Expand Up @@ -1266,7 +1266,7 @@ type OnyxValuesMapping = {
[ONYXKEYS.PERSONAL_DETAILS_METADATA]: Record<string, OnyxTypes.PersonalDetailsMetadata>;
[ONYXKEYS.TASK]: OnyxTypes.Task;
[ONYXKEYS.CURRENCY_LIST]: OnyxTypes.CurrencyList;
[ONYXKEYS.UPDATE_AVAILABLE]: boolean;
[ONYXKEYS.RAM_ONLY_UPDATE_AVAILABLE]: boolean;
[ONYXKEYS.SCREEN_SHARE_REQUEST]: OnyxTypes.ScreenShareRequest;
[ONYXKEYS.COUNTRY_CODE]: number;
[ONYXKEYS.COUNTRY]: string;
Expand Down Expand Up @@ -1321,7 +1321,7 @@ type OnyxValuesMapping = {
[ONYXKEYS.NVP_PRIVATE_BILLING_DISPUTE_PENDING]: number;
[ONYXKEYS.NVP_PRIVATE_BILLING_STATUS]: OnyxTypes.BillingStatus;
[ONYXKEYS.USER_WALLET]: OnyxTypes.UserWallet;
[ONYXKEYS.WALLET_ONFIDO]: OnyxTypes.WalletOnfido;
[ONYXKEYS.RAM_ONLY_WALLET_ONFIDO]: OnyxTypes.WalletOnfido;
[ONYXKEYS.WALLET_ADDITIONAL_DETAILS]: OnyxTypes.WalletAdditionalDetails;
[ONYXKEYS.WALLET_TERMS]: OnyxTypes.WalletTerms;
[ONYXKEYS.BANK_ACCOUNT_LIST]: OnyxTypes.BankAccountList;
Expand Down Expand Up @@ -1350,7 +1350,7 @@ type OnyxValuesMapping = {
[ONYXKEYS.LAST_ACCESSED_WORKSPACE_POLICY_ID]: string;
[ONYXKEYS.SHOULD_SHOW_COMPOSE_INPUT]: boolean;
[ONYXKEYS.IS_BETA]: boolean;
[ONYXKEYS.IS_CHECKING_PUBLIC_ROOM]: boolean;
[ONYXKEYS.RAM_ONLY_IS_CHECKING_PUBLIC_ROOM]: boolean;
[ONYXKEYS.MY_DOMAIN_SECURITY_GROUPS]: Record<string, string>;
[ONYXKEYS.VERIFY_3DS_SUBSCRIPTION]: string;
[ONYXKEYS.PREFERRED_THEME]: ValueOf<typeof CONST.THEME>;
Expand All @@ -1367,10 +1367,10 @@ type OnyxValuesMapping = {
[ONYXKEYS.ONBOARDING_POLICY_ID]: string;
[ONYXKEYS.ONBOARDING_ADMINS_CHAT_REPORT_ID]: string;
[ONYXKEYS.ONBOARDING_LAST_VISITED_PATH]: string;
[ONYXKEYS.IS_SEARCHING_FOR_REPORTS]: boolean;
[ONYXKEYS.RAM_ONLY_IS_SEARCHING_FOR_REPORTS]: boolean;
[ONYXKEYS.LAST_VISITED_PATH]: string | undefined;
[ONYXKEYS.RECENTLY_USED_REPORT_FIELDS]: OnyxTypes.RecentlyUsedReportFields;
[ONYXKEYS.UPDATE_REQUIRED]: boolean;
[ONYXKEYS.RAM_ONLY_UPDATE_REQUIRED]: boolean;
[ONYXKEYS.SUPPORTAL_PERMISSION_DENIED]: OnyxTypes.SupportalPermissionDenied | null;
[ONYXKEYS.RESET_REQUIRED]: boolean;
[ONYXKEYS.PLAID_CURRENT_EVENT]: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function BaseVacationDelegateSelectionComponent({
const styles = useThemeStyles();
const icons = useMemoizedLazyExpensifyIcons(['FallbackAvatar']);
const [countryCode = CONST.DEFAULT_COUNTRY_CODE] = useOnyx(ONYXKEYS.COUNTRY_CODE);
const [isSearchingForReports] = useOnyx(ONYXKEYS.IS_SEARCHING_FOR_REPORTS, {initWithStoredValues: false});
const [isSearchingForReports] = useOnyx(ONYXKEYS.RAM_ONLY_IS_SEARCHING_FOR_REPORTS);

const currentVacationDelegate = vacationDelegate?.delegate ?? '';
const delegatePersonalDetails = getPersonalDetailByEmail(currentVacationDelegate);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function UserSelectPopup({value, closeOverlay, onChange, isSearchable}: UserSele
const [countryCode = CONST.DEFAULT_COUNTRY_CODE] = useOnyx(ONYXKEYS.COUNTRY_CODE);
const [loginList] = useOnyx(ONYXKEYS.LOGIN_LIST);
const [searchTerm, setSearchTerm] = useState('');
const [isSearchingForReports] = useOnyx(ONYXKEYS.IS_SEARCHING_FOR_REPORTS, {initWithStoredValues: false});
const [isSearchingForReports] = useOnyx(ONYXKEYS.RAM_ONLY_IS_SEARCHING_FOR_REPORTS);

const getInitialSelectedIDs = useCallback(() => {
return value.reduce<Set<string>>((acc, id) => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/Search/SearchFiltersChatsSelector.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function SearchFiltersChatsSelector({initialReportIDs, onFiltersUpdate, isScreen
const currentUserAccountID = currentUserPersonalDetails.accountID;
const currentUserEmail = currentUserPersonalDetails.email ?? '';

const [isSearchingForReports] = useOnyx(ONYXKEYS.IS_SEARCHING_FOR_REPORTS, {initWithStoredValues: false});
const [isSearchingForReports] = useOnyx(ONYXKEYS.RAM_ONLY_IS_SEARCHING_FOR_REPORTS);
const reportAttributesDerived = useReportAttributes();
const [selectedReportIDs, setSelectedReportIDs] = useState<string[]>(initialReportIDs);
const [searchTerm, debouncedSearchTerm, setSearchTerm] = useDebouncedState('');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ function SearchFiltersParticipantsSelector({initialAccountIDs, onFiltersUpdate,
const {options, areOptionsInitialized} = useOptionsList({
shouldInitialize: didScreenTransitionEnd,
});
const [isSearchingForReports] = useOnyx(ONYXKEYS.IS_SEARCHING_FOR_REPORTS, {initWithStoredValues: false});
const [isSearchingForReports] = useOnyx(ONYXKEYS.RAM_ONLY_IS_SEARCHING_FOR_REPORTS);
const reportAttributesDerived = useReportAttributes();
const [countryCode = CONST.DEFAULT_COUNTRY_CODE] = useOnyx(ONYXKEYS.COUNTRY_CODE);
const [loginList] = useOnyx(ONYXKEYS.LOGIN_LIST);
Expand Down
2 changes: 1 addition & 1 deletion src/components/Search/SearchRouter/SearchRouter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ function SearchRouter({onRouterClose, shouldHideInputCaret, isSearchRouterDispla
const {setShouldResetSearchQuery} = useSearchActionsContext();
const currentUserPersonalDetails = useCurrentUserPersonalDetails();
const currentUserAccountID = currentUserPersonalDetails.accountID;
const [isSearchingForReports] = useOnyx(ONYXKEYS.IS_SEARCHING_FOR_REPORTS, {initWithStoredValues: false});
const [isSearchingForReports] = useOnyx(ONYXKEYS.RAM_ONLY_IS_SEARCHING_FOR_REPORTS);
const [introSelected] = useOnyx(ONYXKEYS.NVP_INTRO_SELECTED);
const personalDetails = usePersonalDetails();
const [reports] = useOnyx(ONYXKEYS.COLLECTION.REPORT);
Expand Down
2 changes: 1 addition & 1 deletion src/libs/actions/App.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ Onyx.connectWithoutView({

const KEYS_TO_PRESERVE: OnyxKey[] = [
ONYXKEYS.ACCOUNT,
ONYXKEYS.IS_CHECKING_PUBLIC_ROOM,
ONYXKEYS.RAM_ONLY_IS_CHECKING_PUBLIC_ROOM,
ONYXKEYS.IS_LOADING_APP,
ONYXKEYS.IS_SIDEBAR_LOADED,
ONYXKEYS.MODAL,
Expand Down
2 changes: 1 addition & 1 deletion src/libs/actions/AppUpdate/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import ONYXKEYS from '@src/ONYXKEYS';
import updateApp from './updateApp';

function triggerUpdateAvailable() {
Onyx.set(ONYXKEYS.UPDATE_AVAILABLE, true);
Onyx.set(ONYXKEYS.RAM_ONLY_UPDATE_AVAILABLE, true);
}

function setIsAppInBeta(isBeta: boolean) {
Expand Down
2 changes: 1 addition & 1 deletion src/libs/actions/QueuedOnyxUpdates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function flushQueue(): Promise<void> {
ONYXKEYS.CREDENTIALS,
ONYXKEYS.IS_SIDEBAR_LOADED,
ONYXKEYS.ACCOUNT,
ONYXKEYS.IS_CHECKING_PUBLIC_ROOM,
ONYXKEYS.RAM_ONLY_IS_CHECKING_PUBLIC_ROOM,
ONYXKEYS.MODAL,
ONYXKEYS.NETWORK,
ONYXKEYS.SHOULD_SHOW_COMPOSE_INPUT,
Expand Down
20 changes: 10 additions & 10 deletions src/libs/actions/Report/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@
// map of reportID to all reportActions for that report
const allReportActions: OnyxCollection<ReportActions> = {};

Onyx.connect({

Check warning on line 368 in src/libs/actions/Report/index.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.REPORT_ACTIONS,
callback: (actions, key) => {
if (!key || !actions) {
Expand All @@ -377,7 +377,7 @@
});

let allReports: OnyxCollection<Report>;
Onyx.connect({

Check warning on line 380 in src/libs/actions/Report/index.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.COLLECTION.REPORT,
waitForCollectionCallback: true,
callback: (value) => {
Expand All @@ -386,7 +386,7 @@
});

let allPersonalDetails: OnyxEntry<PersonalDetailsList> = {};
Onyx.connect({

Check warning on line 389 in src/libs/actions/Report/index.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.PERSONAL_DETAILS_LIST,
callback: (value) => {
allPersonalDetails = value ?? {};
Expand All @@ -404,7 +404,7 @@
});

let onboarding: OnyxEntry<Onboarding>;
Onyx.connect({

Check warning on line 407 in src/libs/actions/Report/index.ts

View workflow job for this annotation

GitHub Actions / Changed files ESLint check

Onyx.connect() is deprecated. Use useOnyx() hook instead and pass the data as parameters to a pure function
key: ONYXKEYS.NVP_ONBOARDING,
callback: (val) => {
if (Array.isArray(val)) {
Expand Down Expand Up @@ -1347,7 +1347,7 @@
});
}

const finallyData: Array<OnyxUpdate<typeof ONYXKEYS.IS_CHECKING_PUBLIC_ROOM>> = [];
const finallyData: Array<OnyxUpdate<typeof ONYXKEYS.RAM_ONLY_IS_CHECKING_PUBLIC_ROOM>> = [];

const parameters: OpenReportParams = {
reportID,
Expand Down Expand Up @@ -1614,7 +1614,7 @@
if (isFromDeepLink) {
finallyData.push({
onyxMethod: Onyx.METHOD.SET,
key: ONYXKEYS.IS_CHECKING_PUBLIC_ROOM,
key: ONYXKEYS.RAM_ONLY_IS_CHECKING_PUBLIC_ROOM,
value: false,
});

Expand Down Expand Up @@ -4145,7 +4145,7 @@
}

function doneCheckingPublicRoom() {
Onyx.set(ONYXKEYS.IS_CHECKING_PUBLIC_ROOM, false);
Onyx.set(ONYXKEYS.RAM_ONLY_IS_CHECKING_PUBLIC_ROOM, false);
}

function navigateToMostRecentReport(currentReport: OnyxEntry<Report>, conciergeReportID: string | undefined, currentUserAccountID: number, introSelected: OnyxEntry<IntroSelected>) {
Expand Down Expand Up @@ -5001,22 +5001,22 @@
function searchForReports(isOffline: boolean, searchInput: string, policyID?: string, isUserSearch = false) {
// We do not try to make this request while offline because it sets a loading indicator optimistically
if (isOffline) {
Onyx.set(ONYXKEYS.IS_SEARCHING_FOR_REPORTS, false);
Onyx.set(ONYXKEYS.RAM_ONLY_IS_SEARCHING_FOR_REPORTS, false);
return;
}

const successData: Array<OnyxUpdate<typeof ONYXKEYS.IS_SEARCHING_FOR_REPORTS>> = [
const successData: Array<OnyxUpdate<typeof ONYXKEYS.RAM_ONLY_IS_SEARCHING_FOR_REPORTS>> = [
{
onyxMethod: Onyx.METHOD.MERGE,
key: ONYXKEYS.IS_SEARCHING_FOR_REPORTS,
key: ONYXKEYS.RAM_ONLY_IS_SEARCHING_FOR_REPORTS,
value: false,
},
];

const failureData: Array<OnyxUpdate<typeof ONYXKEYS.IS_SEARCHING_FOR_REPORTS>> = [
const failureData: Array<OnyxUpdate<typeof ONYXKEYS.RAM_ONLY_IS_SEARCHING_FOR_REPORTS>> = [
{
onyxMethod: Onyx.METHOD.MERGE,
key: ONYXKEYS.IS_SEARCHING_FOR_REPORTS,
key: ONYXKEYS.RAM_ONLY_IS_SEARCHING_FOR_REPORTS,
value: false,
},
];
Expand All @@ -5040,14 +5040,14 @@
// We are not getting isOffline from components as useEffect change will re-trigger the search on network change
const isOffline = NetworkStore.isOffline();
if (isOffline || !searchInput.trim().length) {
Onyx.set(ONYXKEYS.IS_SEARCHING_FOR_REPORTS, false);
Onyx.set(ONYXKEYS.RAM_ONLY_IS_SEARCHING_FOR_REPORTS, false);
return;
}

// Why not set this in optimistic data? It won't run until the API request happens and while the API request is debounced
// we want to show the loading state right away. Otherwise, we will see a flashing UI where the client options are sorted and
// tell the user there are no options, then we start searching, and tell them there are no options again.
Onyx.set(ONYXKEYS.IS_SEARCHING_FOR_REPORTS, true);
Onyx.set(ONYXKEYS.RAM_ONLY_IS_SEARCHING_FOR_REPORTS, true);
searchForReports(isOffline, searchInput, policyID, isUserSearch);
}

Expand Down
2 changes: 1 addition & 1 deletion src/libs/actions/UpdateRequired.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import Onyx from 'react-native-onyx';
import ONYXKEYS from '@src/ONYXKEYS';

function alertUser() {
Onyx.set(ONYXKEYS.UPDATE_REQUIRED, true);
Onyx.set(ONYXKEYS.RAM_ONLY_UPDATE_REQUIRED, true);
}

export {
Expand Down
Loading
Loading