From 8e2368d396cfaa93988b0b1236b33718c7614f4c Mon Sep 17 00:00:00 2001 From: Julian Kobrynski Date: Tue, 7 Apr 2026 15:16:16 +0200 Subject: [PATCH 1/6] Revert "Revert '[Onyx Audit] Migrate keys to RAM-only part 2/2'" --- src/DelegateAccessHandler.tsx | 2 +- src/ONYXKEYS.ts | 24 ++++++------- src/components/AddPlaidBankAccount.tsx | 13 ++++--- src/components/LocaleContextProvider.tsx | 2 +- .../MoneyRequestReportView.tsx | 2 +- src/components/PriorityModeController.tsx | 2 +- .../ProductTrainingContext/index.tsx | 2 +- .../ListItem/TransactionGroupListExpanded.tsx | 2 +- src/hooks/useMobileSelectionMode.ts | 2 +- src/hooks/useOnboardingFlow.ts | 2 +- src/hooks/useSearchBackPress/index.android.ts | 2 +- src/languages/IntlStore.ts | 2 +- .../AppNavigator/AuthScreensInitHandler.tsx | 4 +-- src/libs/Navigation/guards/index.ts | 2 +- src/libs/PersonalDetailsUtils.ts | 2 +- src/libs/ReportUtils.ts | 3 +- src/libs/actions/App.ts | 29 ++++++++------- src/libs/actions/Card.ts | 18 +++++----- src/libs/actions/Delegate.ts | 4 +-- src/libs/actions/MobileSelectionMode.ts | 4 +-- src/libs/actions/OnyxDerived/index.ts | 3 +- src/libs/actions/OnyxUpdateManager/index.ts | 2 +- src/libs/actions/QueuedOnyxUpdates.ts | 6 ++-- src/libs/actions/Session/index.ts | 4 +-- src/libs/actions/SignInRedirect.ts | 2 +- src/libs/actions/Wallet.ts | 22 +++++++++++- src/libs/actions/Welcome/index.ts | 3 +- src/pages/ConciergePage.tsx | 2 +- .../EnablePayments/EnablePaymentsPage.tsx | 36 +++++++++++++------ src/pages/NewReportWorkspaceSelectionPage.tsx | 2 +- .../ReimbursementAccountPage.tsx | 2 +- src/pages/ReportChangeWorkspacePage.tsx | 2 +- .../SearchFiltersWorkspacePage.tsx | 2 +- .../Search/SearchMoneyRequestReportPage.tsx | 2 +- src/pages/SetDefaultWorkspacePage.tsx | 2 +- src/pages/ValidateLoginPage/index.website.tsx | 19 ++++++---- src/pages/home/ForYouSection/index.tsx | 4 +-- src/pages/home/HomePage.tsx | 4 +-- src/pages/inbox/ReportFetchHandler.tsx | 4 +-- src/pages/inbox/ReportNotFoundGuard.tsx | 4 +-- src/pages/inbox/report/ReportActionsView.tsx | 2 +- .../withReportAndReportActionOrNotFound.tsx | 2 +- .../inbox/report/withReportOrNotFound.tsx | 2 +- src/pages/inbox/sidebar/BaseSidebarScreen.tsx | 4 +-- .../menuItems/NewWorkspaceMenuItem.tsx | 2 +- .../sidebar/ProfileAvatarWithIndicator.tsx | 2 +- src/pages/inbox/sidebar/SidebarLinks.tsx | 2 +- .../step/withWritableReportOrNotFound.tsx | 2 +- .../routes/ProfileAvatarModalContent.tsx | 2 +- .../routes/WorkspaceAvatarModalContent.tsx | 2 +- .../ReportAddAttachmentModalContent/index.tsx | 2 +- .../report/ReportAttachmentModalContent.tsx | 2 +- .../report/ReportAvatarModalContent.tsx | 2 +- .../Contacts/ContactMethodDetailsPage.tsx | 2 +- .../settings/Profile/DisplayNamePage.tsx | 2 +- .../PersonalDetails/BaseLegalNamePage.tsx | 2 +- .../PersonalDetails/DateOfBirthPage.tsx | 2 +- .../PersonalDetails/PersonalAddressPage.tsx | 2 +- .../PersonalDetails/PhoneNumberPage.tsx | 2 +- src/pages/settings/Profile/ProfilePage.tsx | 2 +- src/pages/settings/Profile/PronounsPage.tsx | 2 +- .../Subscription/SubscriptionSettingsPage.tsx | 2 +- .../settings/Wallet/WalletPage/index.tsx | 2 +- .../workspace/AccessOrNotFoundWrapper.tsx | 2 +- src/pages/workspace/WorkspacesListPage.tsx | 2 +- .../expensifyCard/issueNew/AssigneeStep.tsx | 2 +- .../expensifyCard/issueNew/CardNameStep.tsx | 2 +- .../expensifyCard/issueNew/CardTypeStep.tsx | 2 +- .../issueNew/ConfirmationStep.tsx | 2 +- .../issueNew/InviteNewMemberStep.tsx | 2 +- .../IssueNewCardConfirmMagicCodePage.tsx | 2 +- .../issueNew/IssueNewCardPage.tsx | 2 +- .../expensifyCard/issueNew/LimitTypeStep.tsx | 2 +- .../issueNew/SetExpiryOptionsStep.tsx | 2 +- .../withPolicyAndFullscreenLoading.tsx | 2 +- src/setup/index.ts | 8 ++++- src/types/onyx/UserWallet.ts | 3 ++ tests/actions/QueuedOnyxUpdatesTest.ts | 16 ++++----- tests/actions/ReportTest.ts | 6 ++-- tests/perf-test/SidebarLinks.perf-test.tsx | 4 +-- tests/ui/AddressPageTest.tsx | 6 ++-- tests/ui/AuthScreensInitHandlerTest.tsx | 4 +-- tests/ui/ForYouSectionTest.tsx | 2 +- tests/ui/GroupChatNameTests.tsx | 2 +- tests/ui/LHNItemsPresence.tsx | 2 +- tests/ui/PaginationTest.tsx | 2 +- tests/ui/ProfilePageTest.tsx | 4 +-- tests/ui/ReportActionsViewTest.tsx | 24 ++++++------- tests/ui/ReportAttachments.tsx | 2 +- tests/ui/SessionTest.tsx | 2 +- tests/ui/UnreadIndicatorsTest.tsx | 2 +- ...orkspaceWorkflowsApprovalsEditPageTest.tsx | 2 +- .../ProductTrainingContextProvider.tsx | 4 +-- tests/unit/ContactMethodDetailsPageTest.tsx | 2 +- tests/unit/LocalizeTests.ts | 2 +- tests/unit/OnyxDerivedTest.tsx | 2 +- tests/unit/ReportActionItemSingleTest.ts | 2 +- tests/unit/SidebarOrderTest.ts | 36 +++++++++---------- tests/unit/SidebarTest.ts | 4 +-- 99 files changed, 256 insertions(+), 209 deletions(-) diff --git a/src/DelegateAccessHandler.tsx b/src/DelegateAccessHandler.tsx index b3683c672cf9..e1477201bd7c 100644 --- a/src/DelegateAccessHandler.tsx +++ b/src/DelegateAccessHandler.tsx @@ -22,7 +22,7 @@ function DelegateAccessHandler() { const [stashedCredentials = CONST.EMPTY_OBJECT] = useOnyx(ONYXKEYS.STASHED_CREDENTIALS); const [stashedSession] = useOnyx(ONYXKEYS.STASHED_SESSION); const [hasLoadedApp] = useOnyx(ONYXKEYS.HAS_LOADED_APP); - const [isLoadingApp] = useOnyx(ONYXKEYS.IS_LOADING_APP); + const [isLoadingApp] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); const [sessionAccountID] = useOnyx(ONYXKEYS.SESSION, {selector: accountIDSelector}); const [sessionEmail] = useOnyx(ONYXKEYS.SESSION, {selector: emailSelector}); const {isOffline} = useNetwork(); diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index 80bf3acf5d24..a40f170a5f5b 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -31,7 +31,7 @@ const ONYXKEYS = { DEVICE_ID: 'deviceID', /** Boolean flag set whenever the sidebar has loaded */ - IS_SIDEBAR_LOADED: 'isSidebarLoaded', + RAM_ONLY_IS_SIDEBAR_LOADED: 'isSidebarLoaded', /** Boolean flag set whenever we are searching for reports in the server */ RAM_ONLY_IS_SEARCHING_FOR_REPORTS: 'isSearchingForReports', @@ -210,7 +210,7 @@ const ONYXKEYS = { NVP_PREFERRED_LOCALE: 'nvp_preferredLocale', /** Whether the app is currently loading a translation */ - ARE_TRANSLATIONS_LOADING: 'areTranslationsLoading', + RAM_ONLY_ARE_TRANSLATIONS_LOADING: 'areTranslationsLoading', /** Whether the user has tried focus mode yet */ NVP_TRY_FOCUS_MODE: 'nvp_tryFocusMode', @@ -373,7 +373,7 @@ const ONYXKEYS = { SHARE_BANK_ACCOUNT: 'shareBankAccount', /** Is report data loading? */ - IS_LOADING_REPORT_DATA: 'isLoadingReportData', + RAM_ONLY_IS_LOADING_REPORT_DATA: 'isLoadingReportData', /** Set when we are loading bank accounts for share page */ IS_LOADING_SHARE_BANK_ACCOUNTS: 'isLoadingShareBankAccounts', @@ -382,7 +382,7 @@ const ONYXKEYS = { IS_LOADING_BULK_CHANGE_APPROVER_PAGE: 'isLoadingBulkChangeApproverPage', /** Is report data loading? */ - IS_LOADING_APP: 'isLoadingApp', + RAM_ONLY_IS_LOADING_APP: 'isLoadingApp', /** Is loading policy rules preview? */ IS_LOADING_POLICY_CODING_RULES_PREVIEW: 'isLoadingPolicyCodingRulesPreview', @@ -541,7 +541,7 @@ const ONYXKEYS = { ASSIGN_CARD: 'assignCard', /** Stores the information if mobile selection mode is active */ - MOBILE_SELECTION_MODE: 'mobileSelectionMode', + RAM_ONLY_MOBILE_SELECTION_MODE: 'mobileSelectionMode', NVP_PRIVATE_CANCELLATION_DETAILS: 'nvp_private_cancellationDetails', @@ -796,7 +796,7 @@ const ONYXKEYS = { NVP_EXPENSIFY_REPORT_PDF_FILENAME: 'nvp_expensify_report_PDFFilename_', /** Stores the information about the state of issuing a new card */ - ISSUE_NEW_EXPENSIFY_CARD: 'issueNewExpensifyCard_', + RAM_ONLY_ISSUE_NEW_EXPENSIFY_CARD: 'issueNewExpensifyCard_', /** Used for identifying user as admin of a domain */ SHARED_NVP_PRIVATE_ADMIN_ACCESS: 'sharedNVP_private_admin_access_', @@ -1275,7 +1275,7 @@ type OnyxCollectionValuesMapping = { [ONYXKEYS.COLLECTION.LAST_SELECTED_FEED]: OnyxTypes.CompanyCardFeedWithDomainID; [ONYXKEYS.COLLECTION.LAST_SELECTED_EXPENSIFY_CARD_FEED]: OnyxTypes.FundID; [ONYXKEYS.COLLECTION.NVP_EXPENSIFY_ON_CARD_WAITLIST]: OnyxTypes.CardOnWaitlist; - [ONYXKEYS.COLLECTION.ISSUE_NEW_EXPENSIFY_CARD]: OnyxTypes.IssueNewCard; + [ONYXKEYS.COLLECTION.RAM_ONLY_ISSUE_NEW_EXPENSIFY_CARD]: OnyxTypes.IssueNewCard; [ONYXKEYS.COLLECTION.SHARED_NVP_PRIVATE_ADMIN_ACCESS]: boolean; [ONYXKEYS.COLLECTION.SAML_METADATA]: OnyxTypes.SamlMetadata; [ONYXKEYS.COLLECTION.DOMAIN_PENDING_ACTIONS]: OnyxTypes.DomainPendingActions; @@ -1299,7 +1299,7 @@ type OnyxValuesMapping = { [ONYXKEYS.RECENTLY_USED_CURRENCIES]: string[]; [ONYXKEYS.ACTIVE_CLIENTS]: string[]; [ONYXKEYS.DEVICE_ID]: string; - [ONYXKEYS.IS_SIDEBAR_LOADED]: boolean; + [ONYXKEYS.RAM_ONLY_IS_SIDEBAR_LOADED]: boolean; [ONYXKEYS.PERSISTED_REQUESTS]: OnyxTypes.AnyRequest[]; [ONYXKEYS.PERSISTED_ONGOING_REQUESTS]: OnyxTypes.AnyRequest; [ONYXKEYS.CURRENT_DATE]: string; @@ -1366,7 +1366,7 @@ type OnyxValuesMapping = { [ONYXKEYS.ONFIDO_TOKEN]: string; [ONYXKEYS.ONFIDO_APPLICANT_ID]: string; [ONYXKEYS.NVP_PREFERRED_LOCALE]: OnyxTypes.Locale; - [ONYXKEYS.ARE_TRANSLATIONS_LOADING]: boolean; + [ONYXKEYS.RAM_ONLY_ARE_TRANSLATIONS_LOADING]: boolean; [ONYXKEYS.NVP_ACTIVE_POLICY_ID]: string; [ONYXKEYS.NVP_DISMISSED_REFERRAL_BANNERS]: OnyxTypes.DismissedReferralBanners; [ONYXKEYS.NVP_HAS_SEEN_TRACK_TRAINING]: boolean; @@ -1399,12 +1399,12 @@ type OnyxValuesMapping = { [ONYXKEYS.IS_LOADING_SHARE_BANK_ACCOUNTS]: boolean; [ONYXKEYS.IS_LOADING_BULK_CHANGE_APPROVER_PAGE]: boolean; [ONYXKEYS.IS_LOADING_POLICY_CODING_RULES_PREVIEW]: boolean; + [ONYXKEYS.RAM_ONLY_IS_LOADING_REPORT_DATA]: boolean; [ONYXKEYS.IS_SEARCH_FILTERS_CARD_DATA_LOADED]: boolean; [ONYXKEYS.IS_LOADING_SUBSCRIPTION_DATA]: boolean; [ONYXKEYS.IS_SEARCH_PAGE_DATA_LOADED]: boolean; - [ONYXKEYS.IS_LOADING_REPORT_DATA]: boolean; [ONYXKEYS.IS_TEST_TOOLS_MODAL_OPEN]: boolean; - [ONYXKEYS.IS_LOADING_APP]: boolean; + [ONYXKEYS.RAM_ONLY_IS_LOADING_APP]: boolean; [ONYXKEYS.HAS_LOADED_APP]: boolean; [ONYXKEYS.WALLET_TRANSFER]: OnyxTypes.WalletTransfer; [ONYXKEYS.LAST_ACCESSED_WORKSPACE_POLICY_ID]: string; @@ -1452,7 +1452,7 @@ type OnyxValuesMapping = { [ONYXKEYS.ADD_NEW_COMPANY_CARD]: OnyxTypes.AddNewCompanyCardFeed; [ONYXKEYS.ADD_NEW_PERSONAL_CARD]: OnyxTypes.AddNewPersonalCard; [ONYXKEYS.ASSIGN_CARD]: OnyxTypes.AssignCard; - [ONYXKEYS.MOBILE_SELECTION_MODE]: boolean; + [ONYXKEYS.RAM_ONLY_MOBILE_SELECTION_MODE]: boolean; [ONYXKEYS.DUPLICATE_WORKSPACE]: OnyxTypes.DuplicateWorkspace; [ONYXKEYS.NVP_FIRST_DAY_FREE_TRIAL]: string; [ONYXKEYS.NVP_LAST_DAY_FREE_TRIAL]: string; diff --git a/src/components/AddPlaidBankAccount.tsx b/src/components/AddPlaidBankAccount.tsx index c68624505d5a..fc011a18ee2a 100644 --- a/src/components/AddPlaidBankAccount.tsx +++ b/src/components/AddPlaidBankAccount.tsx @@ -83,19 +83,20 @@ function AddPlaidBankAccount({ const subscribedKeyboardShortcuts = useRef void>>([]); const previousNetworkState = useRef(undefined); const [selectedPlaidAccountMask, setSelectedPlaidAccountMask] = useState(defaultSelectedPlaidAccountMask); - const [plaidLinkToken] = useOnyx(ONYXKEYS.PLAID_LINK_TOKEN, {initWithStoredValues: false}); + const [plaidLinkToken] = useOnyx(ONYXKEYS.PLAID_LINK_TOKEN); + const [isPlaidTokenReady, setIsPlaidTokenReady] = useState(false); const [isPlaidDisabled] = useOnyx(ONYXKEYS.IS_PLAID_DISABLED); const {translate} = useLocalize(); const {isOffline} = useNetwork(); const getPlaidLinkToken = (): string | undefined => { - if (plaidLinkToken) { - return plaidLinkToken; - } - if (receivedRedirectURI && plaidLinkOAuthToken) { return plaidLinkOAuthToken; } + + if (isPlaidTokenReady && plaidLinkToken) { + return plaidLinkToken; + } }; /** @@ -140,9 +141,11 @@ function AddPlaidBankAccount({ // If we're coming from Plaid OAuth flow then we need to reuse the existing plaidLinkToken if (isAuthenticatedWithPlaid()) { + setIsPlaidTokenReady(true); return unsubscribeToNavigationShortcuts; } openPlaidBankLogin(allowDebit, bankAccountID); + setIsPlaidTokenReady(true); return unsubscribeToNavigationShortcuts; // disabling this rule, as we want this to run only on the first render diff --git a/src/components/LocaleContextProvider.tsx b/src/components/LocaleContextProvider.tsx index c11d6943463d..268c9968ff34 100644 --- a/src/components/LocaleContextProvider.tsx +++ b/src/components/LocaleContextProvider.tsx @@ -85,7 +85,7 @@ const COLLATOR_OPTIONS: Intl.CollatorOptions = {usage: 'sort', sensitivity: 'var function LocaleContextProvider({children}: LocaleContextProviderProps) { const currentUserPersonalDetails = useCurrentUserPersonalDetails(); - const [areTranslationsLoading = true] = useOnyx(ONYXKEYS.ARE_TRANSLATIONS_LOADING, {initWithStoredValues: false}); + const [areTranslationsLoading = true] = useOnyx(ONYXKEYS.RAM_ONLY_ARE_TRANSLATIONS_LOADING); const [countryCodeByIP = 1] = useOnyx(ONYXKEYS.COUNTRY_CODE); const [nvpPreferredLocale, nvpPreferredLocaleMetadata] = useOnyx(ONYXKEYS.NVP_PREFERRED_LOCALE); const [currentLocale, setCurrentLocale] = useState(() => IntlStore.getCurrentLocale()); diff --git a/src/components/MoneyRequestReportView/MoneyRequestReportView.tsx b/src/components/MoneyRequestReportView/MoneyRequestReportView.tsx index a4c1b2bfda36..1a5688c13721 100644 --- a/src/components/MoneyRequestReportView/MoneyRequestReportView.tsx +++ b/src/components/MoneyRequestReportView/MoneyRequestReportView.tsx @@ -116,7 +116,7 @@ function MoneyRequestReportView({report, policy, reportMetadata, shouldDisplayRe const {isSmallScreenWidth} = useResponsiveLayout(); const reportID = report?.reportID; - const [isLoadingApp] = useOnyx(ONYXKEYS.IS_LOADING_APP); + const [isLoadingApp] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); const {reportPendingAction, reportErrors} = getReportOfflinePendingActionAndErrors(report); const [chatReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${getNonEmptyStringOnyxID(report?.chatReportID)}`); diff --git a/src/components/PriorityModeController.tsx b/src/components/PriorityModeController.tsx index bbed955ea936..02b3ec8b3609 100644 --- a/src/components/PriorityModeController.tsx +++ b/src/components/PriorityModeController.tsx @@ -30,7 +30,7 @@ const isInFocusModeSelector = (priorityMode: OnyxEntry({ }); function ProductTrainingContextProvider({children}: ChildrenProps) { - const [isLoadingApp = true] = useOnyx(ONYXKEYS.IS_LOADING_APP); + const [isLoadingApp = true] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); const [tryNewDot] = useOnyx(ONYXKEYS.NVP_TRY_NEW_DOT); const hasBeenAddedToNudgeMigration = !!tryNewDot?.nudgeMigration?.timestamp; const [isOnboardingCompleted = true, isOnboardingCompletedMetadata] = useOnyx(ONYXKEYS.NVP_ONBOARDING, { diff --git a/src/components/Search/SearchList/ListItem/TransactionGroupListExpanded.tsx b/src/components/Search/SearchList/ListItem/TransactionGroupListExpanded.tsx index 30771565a0a0..19067bb6ade7 100644 --- a/src/components/Search/SearchList/ListItem/TransactionGroupListExpanded.tsx +++ b/src/components/Search/SearchList/ListItem/TransactionGroupListExpanded.tsx @@ -60,7 +60,7 @@ function TransactionGroupListExpanded({ const {windowWidth} = useWindowDimensions(); const currentUserDetails = useCurrentUserPersonalDetails(); const {translate} = useLocalize(); - const [isMobileSelectionModeEnabled] = useOnyx(ONYXKEYS.MOBILE_SELECTION_MODE); + const [isMobileSelectionModeEnabled] = useOnyx(ONYXKEYS.RAM_ONLY_MOBILE_SELECTION_MODE); const [introSelected] = useOnyx(ONYXKEYS.NVP_INTRO_SELECTED); const [betas] = useOnyx(ONYXKEYS.BETAS); const [visibleColumns] = useOnyx(ONYXKEYS.FORMS.SEARCH_ADVANCED_FILTERS_FORM, {selector: columnsSelector}); diff --git a/src/hooks/useMobileSelectionMode.ts b/src/hooks/useMobileSelectionMode.ts index 51f13dc21653..6a75424c74e4 100644 --- a/src/hooks/useMobileSelectionMode.ts +++ b/src/hooks/useMobileSelectionMode.ts @@ -5,7 +5,7 @@ import useOnyx from './useOnyx'; import usePrevious from './usePrevious'; export default function useMobileSelectionMode(onTurnOffSelectionMode = () => {}) { - const [isSelectionModeEnabled = false] = useOnyx(ONYXKEYS.MOBILE_SELECTION_MODE, {initWithStoredValues: false}); + const [isSelectionModeEnabled = false] = useOnyx(ONYXKEYS.RAM_ONLY_MOBILE_SELECTION_MODE); const initialSelectionModeValueRef = useRef(isSelectionModeEnabled); const prevIsSelectionModeEnabled = usePrevious(isSelectionModeEnabled); diff --git a/src/hooks/useOnboardingFlow.ts b/src/hooks/useOnboardingFlow.ts index 0a70def30062..c051b4d90063 100644 --- a/src/hooks/useOnboardingFlow.ts +++ b/src/hooks/useOnboardingFlow.ts @@ -19,7 +19,7 @@ import useOnyx from './useOnyx'; */ function useOnboardingFlowRouter() { const currentUrl = getCurrentUrl(); - const [isLoadingApp = true] = useOnyx(ONYXKEYS.IS_LOADING_APP); + const [isLoadingApp = true] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); const [onboardingValues, isOnboardingCompletedMetadata] = useOnyx(ONYXKEYS.NVP_ONBOARDING); const [sessionEmail] = useOnyx(ONYXKEYS.SESSION, {selector: emailSelector}); const isLoggingInAsNewSessionUser = isLoggingInAsNewUser(currentUrl, sessionEmail); diff --git a/src/hooks/useSearchBackPress/index.android.ts b/src/hooks/useSearchBackPress/index.android.ts index 4e677b0b7620..b6880b4cd5a9 100644 --- a/src/hooks/useSearchBackPress/index.android.ts +++ b/src/hooks/useSearchBackPress/index.android.ts @@ -7,7 +7,7 @@ import ONYXKEYS from '@src/ONYXKEYS'; import type UseSearchBackPress from './types'; const useSearchBackPress: UseSearchBackPress = ({onClearSelection, onNavigationCallBack}) => { - const [selectionMode] = useOnyx(ONYXKEYS.MOBILE_SELECTION_MODE); + const [selectionMode] = useOnyx(ONYXKEYS.RAM_ONLY_MOBILE_SELECTION_MODE); useFocusEffect( useCallback(() => { const onBackPress = () => { diff --git a/src/languages/IntlStore.ts b/src/languages/IntlStore.ts index 345ccefb887a..b4870c4fb813 100644 --- a/src/languages/IntlStore.ts +++ b/src/languages/IntlStore.ts @@ -24,7 +24,7 @@ import type zhHans from './zh-hans'; // This function was added here to avoid circular dependencies function setAreTranslationsLoading(areTranslationsLoading: boolean) { // eslint-disable-next-line rulesdir/prefer-actions-set-data - Onyx.set(ONYXKEYS.ARE_TRANSLATIONS_LOADING, areTranslationsLoading); + Onyx.set(ONYXKEYS.RAM_ONLY_ARE_TRANSLATIONS_LOADING, areTranslationsLoading); } class IntlStore { diff --git a/src/libs/Navigation/AppNavigator/AuthScreensInitHandler.tsx b/src/libs/Navigation/AppNavigator/AuthScreensInitHandler.tsx index ee2d18c3e942..fa1a09f60e4c 100644 --- a/src/libs/Navigation/AppNavigator/AuthScreensInitHandler.tsx +++ b/src/libs/Navigation/AppNavigator/AuthScreensInitHandler.tsx @@ -43,7 +43,7 @@ function initializePusher(currentUserAccountID?: number, getReportAttributes?: ( * Extracted from AuthScreens to isolate useOnyx subscriptions: * - SESSION, NVP_INTRO_SELECTED, NVP_ACTIVE_POLICY_ID, * NVP_ONBOARDING (tour selector), ONYX_UPDATES_LAST_UPDATE_ID_APPLIED_TO_CLIENT (x2), - * IS_LOADING_APP + * RAM_ONLY_IS_LOADING_APP */ function AuthScreensInitHandler() { const currentUrl = getCurrentUrl(); @@ -59,7 +59,7 @@ function AuthScreensInitHandler() { const [activePolicyID] = useOnyx(ONYXKEYS.NVP_ACTIVE_POLICY_ID); const [isSelfTourViewed] = useOnyx(ONYXKEYS.NVP_ONBOARDING, {selector: hasSeenTourSelector}); const [lastUpdateIDAppliedToClient] = useOnyx(ONYXKEYS.ONYX_UPDATES_LAST_UPDATE_ID_APPLIED_TO_CLIENT); - const [isLoadingApp] = useOnyx(ONYXKEYS.IS_LOADING_APP); + const [isLoadingApp] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); const lastUpdateIDAppliedToClientRef = useRef(lastUpdateIDAppliedToClient); const isLoadingAppRef = useRef(isLoadingApp); diff --git a/src/libs/Navigation/guards/index.ts b/src/libs/Navigation/guards/index.ts index 33851c2907cc..5dccdf56978d 100644 --- a/src/libs/Navigation/guards/index.ts +++ b/src/libs/Navigation/guards/index.ts @@ -23,7 +23,7 @@ Onyx.connectWithoutView({ }); Onyx.connectWithoutView({ - key: ONYXKEYS.IS_LOADING_APP, + key: ONYXKEYS.RAM_ONLY_IS_LOADING_APP, callback: (value) => { isLoadingApp = value ?? true; }, diff --git a/src/libs/PersonalDetailsUtils.ts b/src/libs/PersonalDetailsUtils.ts index 91a0544b6afe..6f0dbdb582c6 100644 --- a/src/libs/PersonalDetailsUtils.ts +++ b/src/libs/PersonalDetailsUtils.ts @@ -41,7 +41,7 @@ let hiddenTranslation = ''; let youTranslation = ''; Onyx.connect({ - key: ONYXKEYS.ARE_TRANSLATIONS_LOADING, + key: ONYXKEYS.RAM_ONLY_ARE_TRANSLATIONS_LOADING, callback: (value) => { if (value ?? true) { return; diff --git a/src/libs/ReportUtils.ts b/src/libs/ReportUtils.ts index b8fdc53bf852..bb85cd67d79e 100644 --- a/src/libs/ReportUtils.ts +++ b/src/libs/ReportUtils.ts @@ -1255,8 +1255,7 @@ let hiddenTranslation = ''; let unavailableTranslation = ''; Onyx.connect({ - key: ONYXKEYS.ARE_TRANSLATIONS_LOADING, - initWithStoredValues: false, + key: ONYXKEYS.RAM_ONLY_ARE_TRANSLATIONS_LOADING, callback: (value) => { if (value ?? true) { return; diff --git a/src/libs/actions/App.ts b/src/libs/actions/App.ts index 111177762bd1..912fef8112bd 100644 --- a/src/libs/actions/App.ts +++ b/src/libs/actions/App.ts @@ -52,9 +52,8 @@ Onyx.connectWithoutView({ // `useOnyx` would trigger extra rerenders without affecting the View, so `Onyx.connectWithoutView` is used instead let isSidebarLoaded: boolean | undefined; Onyx.connectWithoutView({ - key: ONYXKEYS.IS_SIDEBAR_LOADED, + key: ONYXKEYS.RAM_ONLY_IS_SIDEBAR_LOADED, callback: (val) => (isSidebarLoaded = val), - initWithStoredValues: false, }); // `isUsingImportedState` is used in `openApp`, `reconnectApp`, and `clearOnyxAndResetApp` to prevent API calls when using imported state. @@ -121,9 +120,9 @@ Onyx.connectWithoutView({ const KEYS_TO_PRESERVE: OnyxKey[] = [ ONYXKEYS.ACCOUNT, + ONYXKEYS.RAM_ONLY_IS_LOADING_APP, + ONYXKEYS.RAM_ONLY_IS_SIDEBAR_LOADED, ONYXKEYS.IS_CHECKING_PUBLIC_ROOM, - ONYXKEYS.IS_LOADING_APP, - ONYXKEYS.IS_SIDEBAR_LOADED, ONYXKEYS.MODAL, ONYXKEYS.NETWORK, ONYXKEYS.SESSION, @@ -220,11 +219,11 @@ function setSidebarLoaded() { return; } - Onyx.set(ONYXKEYS.IS_SIDEBAR_LOADED, true); + Onyx.set(ONYXKEYS.RAM_ONLY_IS_SIDEBAR_LOADED, true); } function setAppLoading(isLoading: boolean) { - Onyx.set(ONYXKEYS.IS_LOADING_APP, isLoading); + Onyx.set(ONYXKEYS.RAM_ONLY_IS_LOADING_APP, isLoading); } /** @@ -298,9 +297,9 @@ function getPolicyParamsForOpenOrReconnect(): Promise = { optimisticData: [ { onyxMethod: Onyx.METHOD.MERGE, - key: ONYXKEYS.IS_LOADING_REPORT_DATA, + key: ONYXKEYS.RAM_ONLY_IS_LOADING_REPORT_DATA, value: true, }, ], @@ -340,7 +339,7 @@ function getOnyxDataForOpenOrReconnect( finallyData: [ { onyxMethod: Onyx.METHOD.MERGE, - key: ONYXKEYS.IS_LOADING_REPORT_DATA, + key: ONYXKEYS.RAM_ONLY_IS_LOADING_REPORT_DATA, value: false, }, ], @@ -356,13 +355,13 @@ function getOnyxDataForOpenOrReconnect( if (isOpenApp) { result.optimisticData?.push({ onyxMethod: Onyx.METHOD.MERGE, - key: ONYXKEYS.IS_LOADING_APP, + key: ONYXKEYS.RAM_ONLY_IS_LOADING_APP, value: true, }); result.finallyData?.push({ onyxMethod: Onyx.METHOD.MERGE, - key: ONYXKEYS.IS_LOADING_APP, + key: ONYXKEYS.RAM_ONLY_IS_LOADING_APP, value: false, }); } @@ -424,7 +423,7 @@ function openApp(shouldKeepPublicRooms = false, allReportsWithDraftComments?: Re // Exception: When forceRun is true (exiting imported state), always make the API call if (isUsingImportedState && !forceRun) { Onyx.multiSet({ - [ONYXKEYS.IS_LOADING_APP]: false, + [ONYXKEYS.RAM_ONLY_IS_LOADING_APP]: false, [ONYXKEYS.HAS_LOADED_APP]: true, }); return Promise.resolve(); diff --git a/src/libs/actions/Card.ts b/src/libs/actions/Card.ts index 41ed86a7e876..4288af0901fe 100644 --- a/src/libs/actions/Card.ts +++ b/src/libs/actions/Card.ts @@ -745,7 +745,7 @@ function getCardDefaultName(userName?: string) { } function setIssueNewCardStepAndData({data, isEditing, step, policyID, isChangeAssigneeDisabled}: IssueNewCardFlowData) { - Onyx.merge(`${ONYXKEYS.COLLECTION.ISSUE_NEW_EXPENSIFY_CARD}${policyID}`, { + Onyx.merge(`${ONYXKEYS.COLLECTION.RAM_ONLY_ISSUE_NEW_EXPENSIFY_CARD}${policyID}`, { data, isEditing, currentStep: step, @@ -761,7 +761,7 @@ function setDraftInviteAccountID(assigneeEmail: string | undefined, assigneeAcco } function clearIssueNewCardFlow(policyID: string | undefined) { - Onyx.set(`${ONYXKEYS.COLLECTION.ISSUE_NEW_EXPENSIFY_CARD}${policyID}`, { + Onyx.set(`${ONYXKEYS.COLLECTION.RAM_ONLY_ISSUE_NEW_EXPENSIFY_CARD}${policyID}`, { currentStep: null, data: {}, isSuccessful: false, @@ -774,7 +774,7 @@ function clearIssueNewCardFormData() { } function clearIssueNewCardError(policyID: string | undefined) { - Onyx.merge(`${ONYXKEYS.COLLECTION.ISSUE_NEW_EXPENSIFY_CARD}${policyID}`, {errors: null}); + Onyx.merge(`${ONYXKEYS.COLLECTION.RAM_ONLY_ISSUE_NEW_EXPENSIFY_CARD}${policyID}`, {errors: null}); } function buildCardListUpdates(workspaceAccountID: number, cardID: number, cardUpdateData: CardListUpdateData, shouldUpdateCardList: boolean): CardOnyxUpdate[] { @@ -1364,10 +1364,10 @@ function issueExpensifyCard( const {assigneeEmail, limit, limitType, cardTitle, cardType, validFrom, validThru} = data; - const optimisticData: Array> = [ + const optimisticData: Array> = [ { onyxMethod: Onyx.METHOD.MERGE, - key: `${ONYXKEYS.COLLECTION.ISSUE_NEW_EXPENSIFY_CARD}${policyID}`, + key: `${ONYXKEYS.COLLECTION.RAM_ONLY_ISSUE_NEW_EXPENSIFY_CARD}${policyID}`, value: { isLoading: true, errors: null, @@ -1376,10 +1376,10 @@ function issueExpensifyCard( }, ]; - const successData: Array> = [ + const successData: Array> = [ { onyxMethod: Onyx.METHOD.MERGE, - key: `${ONYXKEYS.COLLECTION.ISSUE_NEW_EXPENSIFY_CARD}${policyID}`, + key: `${ONYXKEYS.COLLECTION.RAM_ONLY_ISSUE_NEW_EXPENSIFY_CARD}${policyID}`, value: { isLoading: false, isSuccessful: true, @@ -1387,10 +1387,10 @@ function issueExpensifyCard( }, ]; - const failureData: Array> = [ + const failureData: Array> = [ { onyxMethod: Onyx.METHOD.MERGE, - key: `${ONYXKEYS.COLLECTION.ISSUE_NEW_EXPENSIFY_CARD}${policyID}`, + key: `${ONYXKEYS.COLLECTION.RAM_ONLY_ISSUE_NEW_EXPENSIFY_CARD}${policyID}`, value: { isLoading: false, errors: ErrorUtils.getMicroSecondOnyxErrorWithTranslationKey('common.genericErrorMessage'), diff --git a/src/libs/actions/Delegate.ts b/src/libs/actions/Delegate.ts index 2c66412bc1fd..a31097d7e3a7 100644 --- a/src/libs/actions/Delegate.ts +++ b/src/libs/actions/Delegate.ts @@ -24,7 +24,7 @@ const KEYS_TO_PRESERVE_DELEGATE_ACCESS = [ ONYXKEYS.NVP_TRY_FOCUS_MODE, ONYXKEYS.PREFERRED_THEME, ONYXKEYS.NVP_PREFERRED_LOCALE, - ONYXKEYS.ARE_TRANSLATIONS_LOADING, + ONYXKEYS.RAM_ONLY_ARE_TRANSLATIONS_LOADING, ONYXKEYS.SESSION, ONYXKEYS.STASHED_SESSION, ONYXKEYS.HAS_LOADED_APP, @@ -33,7 +33,7 @@ const KEYS_TO_PRESERVE_DELEGATE_ACCESS = [ // We need to preserve the sidebar loaded state since we never unmount the sidebar when connecting as a delegate // This allows the report screen to load correctly when the delegate token expires and the delegate is returned to their original account. - ONYXKEYS.IS_SIDEBAR_LOADED, + ONYXKEYS.RAM_ONLY_IS_SIDEBAR_LOADED, ONYXKEYS.NETWORK, ONYXKEYS.SHOULD_USE_STAGING_SERVER, ONYXKEYS.IS_DEBUG_MODE_ENABLED, diff --git a/src/libs/actions/MobileSelectionMode.ts b/src/libs/actions/MobileSelectionMode.ts index 65c6e463461b..d21fdca0da8a 100644 --- a/src/libs/actions/MobileSelectionMode.ts +++ b/src/libs/actions/MobileSelectionMode.ts @@ -2,11 +2,11 @@ import Onyx from 'react-native-onyx'; import ONYXKEYS from '@src/ONYXKEYS'; const turnOnMobileSelectionMode = () => { - Onyx.merge(ONYXKEYS.MOBILE_SELECTION_MODE, true); + Onyx.merge(ONYXKEYS.RAM_ONLY_MOBILE_SELECTION_MODE, true); }; const turnOffMobileSelectionMode = () => { - Onyx.merge(ONYXKEYS.MOBILE_SELECTION_MODE, false); + Onyx.merge(ONYXKEYS.RAM_ONLY_MOBILE_SELECTION_MODE, false); }; export {turnOnMobileSelectionMode, turnOffMobileSelectionMode}; diff --git a/src/libs/actions/OnyxDerived/index.ts b/src/libs/actions/OnyxDerived/index.ts index ac245f116b1b..57950c582d5f 100644 --- a/src/libs/actions/OnyxDerived/index.ts +++ b/src/libs/actions/OnyxDerived/index.ts @@ -115,8 +115,7 @@ function init() { } else if (dependencyOnyxKey === ONYXKEYS.NVP_PREFERRED_LOCALE) { // Special case for locale, we want to recompute derived values when the locale change actually loads. Onyx.connectWithoutView({ - key: ONYXKEYS.ARE_TRANSLATIONS_LOADING, - initWithStoredValues: false, + key: ONYXKEYS.RAM_ONLY_ARE_TRANSLATIONS_LOADING, callback: (value) => { if (value ?? true) { Log.info(`[OnyxDerived] translations are still loading, not recomputing derived value for ${key}`); diff --git a/src/libs/actions/OnyxUpdateManager/index.ts b/src/libs/actions/OnyxUpdateManager/index.ts index 5561c6e1e175..cc8c299e13af 100644 --- a/src/libs/actions/OnyxUpdateManager/index.ts +++ b/src/libs/actions/OnyxUpdateManager/index.ts @@ -46,7 +46,7 @@ let isLoadingApp = false; // `isLoadingApp` is not dependent on any changes on the UI, // so it is okay to use `connectWithoutView` here. Onyx.connectWithoutView({ - key: ONYXKEYS.IS_LOADING_APP, + key: ONYXKEYS.RAM_ONLY_IS_LOADING_APP, callback: (value) => { isLoadingApp = value ?? false; }, diff --git a/src/libs/actions/QueuedOnyxUpdates.ts b/src/libs/actions/QueuedOnyxUpdates.ts index be2a1480ccec..9f673b38e566 100644 --- a/src/libs/actions/QueuedOnyxUpdates.ts +++ b/src/libs/actions/QueuedOnyxUpdates.ts @@ -38,12 +38,12 @@ function flushQueue(): Promise { ONYXKEYS.NVP_TRY_FOCUS_MODE, ONYXKEYS.PREFERRED_THEME, ONYXKEYS.NVP_PREFERRED_LOCALE, - ONYXKEYS.ARE_TRANSLATIONS_LOADING, + ONYXKEYS.RAM_ONLY_ARE_TRANSLATIONS_LOADING, ONYXKEYS.SESSION, - ONYXKEYS.IS_LOADING_APP, + ONYXKEYS.RAM_ONLY_IS_LOADING_APP, ONYXKEYS.HAS_LOADED_APP, ONYXKEYS.CREDENTIALS, - ONYXKEYS.IS_SIDEBAR_LOADED, + ONYXKEYS.RAM_ONLY_IS_SIDEBAR_LOADED, ONYXKEYS.ACCOUNT, ONYXKEYS.IS_CHECKING_PUBLIC_ROOM, ONYXKEYS.MODAL, diff --git a/src/libs/actions/Session/index.ts b/src/libs/actions/Session/index.ts index 8219ff12743d..f3ee54c24766 100644 --- a/src/libs/actions/Session/index.ts +++ b/src/libs/actions/Session/index.ts @@ -300,7 +300,7 @@ const KEYS_TO_PRESERVE_SUPPORTAL = [ ONYXKEYS.NVP_TRY_FOCUS_MODE, ONYXKEYS.PREFERRED_THEME, ONYXKEYS.NVP_PREFERRED_LOCALE, - ONYXKEYS.ARE_TRANSLATIONS_LOADING, + ONYXKEYS.RAM_ONLY_ARE_TRANSLATIONS_LOADING, ONYXKEYS.SESSION, ONYXKEYS.STASHED_SESSION, ONYXKEYS.HAS_LOADED_APP, @@ -309,7 +309,7 @@ const KEYS_TO_PRESERVE_SUPPORTAL = [ // We need to preserve the sidebar loaded state since we never unmount the sidebar when connecting as a delegate // This allows the report screen to load correctly when the delegate token expires and the delegate is returned to their original account. - ONYXKEYS.IS_SIDEBAR_LOADED, + ONYXKEYS.RAM_ONLY_IS_SIDEBAR_LOADED, ONYXKEYS.NETWORK, ONYXKEYS.SHOULD_USE_STAGING_SERVER, ONYXKEYS.IS_DEBUG_MODE_ENABLED, diff --git a/src/libs/actions/SignInRedirect.ts b/src/libs/actions/SignInRedirect.ts index 8fcf14765ab0..c07a8cbccbf5 100644 --- a/src/libs/actions/SignInRedirect.ts +++ b/src/libs/actions/SignInRedirect.ts @@ -50,7 +50,7 @@ function clearStorageAndRedirect(errorMessage?: string): Promise { // flashes of unwanted default state. const keysToPreserve: OnyxKey[] = []; keysToPreserve.push(ONYXKEYS.NVP_PREFERRED_LOCALE); - keysToPreserve.push(ONYXKEYS.ARE_TRANSLATIONS_LOADING); + keysToPreserve.push(ONYXKEYS.RAM_ONLY_ARE_TRANSLATIONS_LOADING); keysToPreserve.push(ONYXKEYS.PREFERRED_THEME); keysToPreserve.push(ONYXKEYS.ACTIVE_CLIENTS); keysToPreserve.push(ONYXKEYS.DEVICE_ID); diff --git a/src/libs/actions/Wallet.ts b/src/libs/actions/Wallet.ts index 27625e744cd6..f1d6aa424d44 100644 --- a/src/libs/actions/Wallet.ts +++ b/src/libs/actions/Wallet.ts @@ -206,7 +206,27 @@ function openInitialSettingsPage() { * Fetches data when the user opens the EnablePaymentsPage */ function openEnablePaymentsPage() { - API.read(READ_COMMANDS.OPEN_ENABLE_PAYMENTS_PAGE, null); + const optimisticData: Array> = [ + { + onyxMethod: Onyx.METHOD.MERGE, + key: ONYXKEYS.USER_WALLET, + value: { + isLoading: true, + }, + }, + ]; + + const finallyData: Array> = [ + { + onyxMethod: Onyx.METHOD.MERGE, + key: ONYXKEYS.USER_WALLET, + value: { + isLoading: false, + }, + }, + ]; + + API.read(READ_COMMANDS.OPEN_ENABLE_PAYMENTS_PAGE, null, {optimisticData, finallyData}); } function updateCurrentStep(currentStep: ValueOf | null) { diff --git a/src/libs/actions/Welcome/index.ts b/src/libs/actions/Welcome/index.ts index a10f96e62a8e..2058af77ac1c 100644 --- a/src/libs/actions/Welcome/index.ts +++ b/src/libs/actions/Welcome/index.ts @@ -115,8 +115,7 @@ function completeHybridAppOnboarding() { // We use `connectWithoutView` here since this connection only to get loading flag // and doesn't need to trigger component re-renders. Onyx.connectWithoutView({ - key: ONYXKEYS.IS_LOADING_REPORT_DATA, - initWithStoredValues: false, + key: ONYXKEYS.RAM_ONLY_IS_LOADING_REPORT_DATA, callback: (value) => { isLoadingReportData = value ?? false; checkServerDataReady(); diff --git a/src/pages/ConciergePage.tsx b/src/pages/ConciergePage.tsx index 2b3a804391f5..144e7bcf41dc 100644 --- a/src/pages/ConciergePage.tsx +++ b/src/pages/ConciergePage.tsx @@ -24,7 +24,7 @@ function ConciergePage() { const styles = useThemeStyles(); const isUnmounted = useRef(false); const [session] = useOnyx(ONYXKEYS.SESSION); - const [isLoadingReportData = true] = useOnyx(ONYXKEYS.IS_LOADING_REPORT_DATA); + const [isLoadingReportData = true] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_REPORT_DATA); const [conciergeReportID] = useOnyx(ONYXKEYS.CONCIERGE_REPORT_ID); const [introSelected] = useOnyx(ONYXKEYS.NVP_INTRO_SELECTED); const [betas] = useOnyx(ONYXKEYS.BETAS); diff --git a/src/pages/EnablePayments/EnablePaymentsPage.tsx b/src/pages/EnablePayments/EnablePaymentsPage.tsx index 6968aa048569..af0c83086376 100644 --- a/src/pages/EnablePayments/EnablePaymentsPage.tsx +++ b/src/pages/EnablePayments/EnablePaymentsPage.tsx @@ -1,4 +1,4 @@ -import React, {useEffect} from 'react'; +import React, {useEffect, useRef} from 'react'; import FullScreenLoadingIndicator from '@components/FullscreenLoadingIndicator'; import HeaderWithBackButton from '@components/HeaderWithBackButton'; import ScreenWrapper from '@components/ScreenWrapper'; @@ -22,30 +22,44 @@ import TermsStep from './TermsStep'; function EnablePaymentsPage() { const {translate} = useLocalize(); const {isOffline} = useNetwork(); - const [userWallet] = useOnyx(ONYXKEYS.USER_WALLET, { - // We want to refresh the wallet each time the user attempts to activate the wallet so we won't use the - // stored values here. - initWithStoredValues: false, - }); + const [userWallet] = useOnyx(ONYXKEYS.USER_WALLET); const {isPendingOnfidoResult, hasFailedOnfido} = userWallet ?? {}; + const wasLoadingRef = useRef(false); + // Always fetch fresh wallet data on mount useEffect(() => { if (isOffline) { return; } + openEnablePaymentsPage(); + }, [isOffline]); + + // Only redirect after the fresh data loading cycle (isLoading: true → false) completes, + // to avoid acting on stale cached values from a previous session. + useEffect(() => { + if (isOffline) { + return; + } + + if (userWallet?.isLoading) { + wasLoadingRef.current = true; + return; + } + + if (!wasLoadingRef.current) { + return; + } + // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing if (isPendingOnfidoResult || hasFailedOnfido) { Navigation.navigate(ROUTES.SETTINGS_WALLET, {forceReplace: true}); - return; } - - openEnablePaymentsPage(); - }, [isOffline, isPendingOnfidoResult, hasFailedOnfido]); + }, [isOffline, isPendingOnfidoResult, hasFailedOnfido, userWallet?.isLoading]); const isUserWalletEmpty = isEmptyObject(userWallet); - if (isUserWalletEmpty) { + if (isUserWalletEmpty || userWallet?.isLoading) { const reasonAttributes: SkeletonSpanReasonAttributes = { context: 'EnablePaymentsPage', isUserWalletEmpty, diff --git a/src/pages/NewReportWorkspaceSelectionPage.tsx b/src/pages/NewReportWorkspaceSelectionPage.tsx index 5812cb594d1a..91c00f750102 100644 --- a/src/pages/NewReportWorkspaceSelectionPage.tsx +++ b/src/pages/NewReportWorkspaceSelectionPage.tsx @@ -77,7 +77,7 @@ function NewReportWorkspaceSelectionPage({route}: NewReportWorkspaceSelectionPag const [allTransactions] = useOnyx(ONYXKEYS.COLLECTION.TRANSACTION); const currentUserPersonalDetails = useCurrentUserPersonalDetails(); - const [isLoadingApp] = useOnyx(ONYXKEYS.IS_LOADING_APP); + const [isLoadingApp] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); const shouldShowLoadingIndicator = isLoadingApp && !isOffline; const [pendingPolicySelection, setPendingPolicySelection] = useState<{policy: WorkspaceListItem; shouldShowEmptyReportConfirmation: boolean} | null>(null); diff --git a/src/pages/ReimbursementAccount/ReimbursementAccountPage.tsx b/src/pages/ReimbursementAccount/ReimbursementAccountPage.tsx index 5ce6d74e9545..ae23e28ed5c8 100644 --- a/src/pages/ReimbursementAccount/ReimbursementAccountPage.tsx +++ b/src/pages/ReimbursementAccount/ReimbursementAccountPage.tsx @@ -84,7 +84,7 @@ function ReimbursementAccountPage({route, policy, isLoadingPolicy, navigation}: const [reimbursementAccountDraft] = useOnyx(ONYXKEYS.FORMS.REIMBURSEMENT_ACCOUNT_FORM_DRAFT); const [plaidCurrentEvent = ''] = useOnyx(ONYXKEYS.PLAID_CURRENT_EVENT); const [onfidoToken = ''] = useOnyx(ONYXKEYS.ONFIDO_TOKEN); - const [isLoadingApp = false] = useOnyx(ONYXKEYS.IS_LOADING_APP); + const [isLoadingApp = false] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); const topmostFullScreenRoute = useRootNavigationState((state) => state?.routes.findLast((lastRoute) => isFullScreenName(lastRoute.name))); const {isBetaEnabled} = usePermissions(); diff --git a/src/pages/ReportChangeWorkspacePage.tsx b/src/pages/ReportChangeWorkspacePage.tsx index 96fa4c97a99a..b6610d3eefae 100644 --- a/src/pages/ReportChangeWorkspacePage.tsx +++ b/src/pages/ReportChangeWorkspacePage.tsx @@ -58,7 +58,7 @@ function ReportChangeWorkspacePage({report, route}: ReportChangeWorkspacePagePro const [policies, fetchStatus] = useOnyx(ONYXKEYS.COLLECTION.POLICY); const [reportNextStep] = useOnyx(`${ONYXKEYS.COLLECTION.NEXT_STEP}${reportID}`); const [isChangePolicyTrainingModalDismissed = false] = useOnyx(ONYXKEYS.NVP_DISMISSED_PRODUCT_TRAINING, {selector: changePolicyTrainingModalDismissedSelector}); - const [isLoadingApp] = useOnyx(ONYXKEYS.IS_LOADING_APP); + const [isLoadingApp] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); const [transactionViolations] = useOnyx(ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS); const isReportLastVisibleArchived = useReportIsArchived(report?.parentReportID); const reportOwnerAccountID = report?.ownerAccountID; diff --git a/src/pages/Search/SearchAdvancedFiltersPage/SearchFiltersWorkspacePage.tsx b/src/pages/Search/SearchAdvancedFiltersPage/SearchFiltersWorkspacePage.tsx index bdde4bd61b7d..5b5c99489de6 100644 --- a/src/pages/Search/SearchAdvancedFiltersPage/SearchFiltersWorkspacePage.tsx +++ b/src/pages/Search/SearchAdvancedFiltersPage/SearchFiltersWorkspacePage.tsx @@ -35,7 +35,7 @@ function SearchFiltersWorkspacePage() { const [searchAdvancedFiltersForm] = useOnyx(ONYXKEYS.FORMS.SEARCH_ADVANCED_FILTERS_FORM); const [policies, policiesResult] = useOnyx(ONYXKEYS.COLLECTION.POLICY); const [currentUserLogin] = useOnyx(ONYXKEYS.SESSION, {selector: emailSelector}); - const [isLoadingApp] = useOnyx(ONYXKEYS.IS_LOADING_APP); + const [isLoadingApp] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); const [searchTerm, debouncedSearchTerm, setSearchTerm] = useDebouncedState(''); const shouldShowLoadingIndicator = isLoadingApp && !isOffline; const selectionListRef = useRef>(null); diff --git a/src/pages/Search/SearchMoneyRequestReportPage.tsx b/src/pages/Search/SearchMoneyRequestReportPage.tsx index 4d854cda03a3..6eab2fb51d7a 100644 --- a/src/pages/Search/SearchMoneyRequestReportPage.tsx +++ b/src/pages/Search/SearchMoneyRequestReportPage.tsx @@ -138,7 +138,7 @@ function SearchMoneyRequestReportPage({route}: SearchMoneyRequestPageProps) { const [reportMetadata = defaultReportMetadata] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_METADATA}${reportIDFromRoute}`); const [policies = getEmptyObject>>()] = useOnyx(ONYXKEYS.COLLECTION.POLICY); const policy = policies?.[`${ONYXKEYS.COLLECTION.POLICY}${report?.policyID}`]; - const [isLoadingApp] = useOnyx(ONYXKEYS.IS_LOADING_APP); + const [isLoadingApp] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); const isReportArchived = useReportIsArchived(report?.reportID); const {isEditingDisabled, isCurrentReportLoadedFromOnyx} = useIsReportReadyToDisplay(report, reportIDFromRoute, isReportArchived); diff --git a/src/pages/SetDefaultWorkspacePage.tsx b/src/pages/SetDefaultWorkspacePage.tsx index b1c629c1639f..263deba80010 100644 --- a/src/pages/SetDefaultWorkspacePage.tsx +++ b/src/pages/SetDefaultWorkspacePage.tsx @@ -31,7 +31,7 @@ function SetDefaultWorkspacePage({route}: SetDefaultWorkspacePageProps) { const {translate, localeCompare} = useLocalize(); const [policies, fetchStatus] = useOnyx(ONYXKEYS.COLLECTION.POLICY); - const [isLoadingApp] = useOnyx(ONYXKEYS.IS_LOADING_APP); + const [isLoadingApp] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); const [activePolicyID] = useOnyx(ONYXKEYS.NVP_ACTIVE_POLICY_ID); const shouldShowLoadingIndicator = isLoadingApp && !isOffline; diff --git a/src/pages/ValidateLoginPage/index.website.tsx b/src/pages/ValidateLoginPage/index.website.tsx index 4fe5ad2a7ca1..3081b9ed9744 100644 --- a/src/pages/ValidateLoginPage/index.website.tsx +++ b/src/pages/ValidateLoginPage/index.website.tsx @@ -1,4 +1,4 @@ -import React, {useEffect} from 'react'; +import React, {useEffect, useState} from 'react'; import type {OnyxEntry} from 'react-native-onyx'; import FullScreenLoadingIndicator from '@components/FullscreenLoadingIndicator'; import ExpiredValidateCodeModal from '@components/ValidateCode/ExpiredValidateCodeModal'; @@ -26,10 +26,13 @@ function ValidateLoginPage({ const login = credentials?.login; const isSignedIn = !!session?.authToken && session?.authTokenType !== CONST.AUTH_TOKEN_TYPES.ANONYMOUS; - // To ensure that the previous autoAuthState does not impact the rendering of the current magic link page, the autoAuthState prop sets initWithStoredValues to false. - // This is done unless the user is signed in, in which case the page will be remounted upon successful sign-in, as explained in Session.initAutoAuthState. - const [autoAuthState] = useOnyx(ONYXKEYS.SESSION, {initWithStoredValues: isSignedIn, selector: autoAuthStateSelector}); - const autoAuthStateWithDefault = autoAuthState ?? CONST.AUTO_AUTH_STATE.NOT_STARTED; + // When not signed in, ignore stored autoAuthState on the first render to prevent stale values + // (e.g. FAILED from a previous magic link attempt) from briefly rendering incorrect UI. + // Once initAutoAuthState() runs in the useEffect, the state is set to true and real values are used. + const [hasInitialized, setHasInitialized] = useState(isSignedIn); + const [autoAuthState] = useOnyx(ONYXKEYS.SESSION, {selector: autoAuthStateSelector}); + const effectiveAutoAuthState = hasInitialized ? autoAuthState : undefined; + const autoAuthStateWithDefault = effectiveAutoAuthState ?? CONST.AUTO_AUTH_STATE.NOT_STARTED; const is2FARequired = !!account?.requiresTwoFactorAuth; const cachedAccountID = credentials?.accountID; const isUserClickedSignIn = !login && isSignedIn && (autoAuthStateWithDefault === CONST.AUTO_AUTH_STATE.SIGNING_IN || autoAuthStateWithDefault === CONST.AUTO_AUTH_STATE.JUST_SIGNED_IN); @@ -38,6 +41,8 @@ function ValidateLoginPage({ const [preferredLocale] = useOnyx(ONYXKEYS.NVP_PREFERRED_LOCALE); useEffect(() => { + setHasInitialized(true); + if (isUserClickedSignIn) { // The user clicked the option to sign in the current tab Navigation.isNavigationReady().then(() => { @@ -82,13 +87,13 @@ function ValidateLoginPage({ )} {autoAuthStateWithDefault === CONST.AUTO_AUTH_STATE.JUST_SIGNED_IN && isSignedIn && !exitTo && !!login && } {/* If session.autoAuthState isn't available yet, we use shouldStartSignInWithValidateCode to conditionally render the component instead of local autoAuthState which contains a default value of NOT_STARTED */} - {(!autoAuthState ? !shouldStartSignInWithValidateCode : autoAuthStateWithDefault === CONST.AUTO_AUTH_STATE.NOT_STARTED && !isNavigatingToExitTo) && ( + {(!effectiveAutoAuthState ? !shouldStartSignInWithValidateCode : autoAuthStateWithDefault === CONST.AUTO_AUTH_STATE.NOT_STARTED && !isNavigatingToExitTo) && ( )} - {(!autoAuthState ? shouldStartSignInWithValidateCode : autoAuthStateWithDefault === CONST.AUTO_AUTH_STATE.SIGNING_IN) && ( + {(!effectiveAutoAuthState ? shouldStartSignInWithValidateCode : autoAuthStateWithDefault === CONST.AUTO_AUTH_STATE.SIGNING_IN) && ( (null); diff --git a/src/pages/inbox/ReportFetchHandler.tsx b/src/pages/inbox/ReportFetchHandler.tsx index c15aa9a2e6bf..fa316de5a35d 100644 --- a/src/pages/inbox/ReportFetchHandler.tsx +++ b/src/pages/inbox/ReportFetchHandler.tsx @@ -74,8 +74,8 @@ function ReportFetchHandler() { const [introSelected] = useOnyx(ONYXKEYS.NVP_INTRO_SELECTED); const [betas] = useOnyx(ONYXKEYS.BETAS); const [onboarding] = useOnyx(ONYXKEYS.NVP_ONBOARDING); - const [isLoadingApp] = useOnyx(ONYXKEYS.IS_LOADING_APP); - const [isLoadingReportData = true] = useOnyx(ONYXKEYS.IS_LOADING_REPORT_DATA); + const [isLoadingApp] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); + const [isLoadingReportData = true] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_REPORT_DATA); const prevIsLoadingReportData = usePrevious(isLoadingReportData); const reportID = reportOnyx?.reportID; diff --git a/src/pages/inbox/ReportNotFoundGuard.tsx b/src/pages/inbox/ReportNotFoundGuard.tsx index c5ce99b3becf..b8753ab8b0ac 100644 --- a/src/pages/inbox/ReportNotFoundGuard.tsx +++ b/src/pages/inbox/ReportNotFoundGuard.tsx @@ -36,8 +36,8 @@ function ReportNotFoundGuard({children}: ReportNotFoundGuardProps) { const [isLoadingInitialReportActions = true] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_METADATA}${reportIDFromRoute}`, { selector: isLoadingInitialReportActionsSelector, }); - const [isLoadingReportData = true] = useOnyx(ONYXKEYS.IS_LOADING_REPORT_DATA); - const [isLoadingApp] = useOnyx(ONYXKEYS.IS_LOADING_APP); + const [isLoadingReportData = true] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_REPORT_DATA); + const [isLoadingApp] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); const [deleteTransactionNavigateBackUrl] = useOnyx(ONYXKEYS.NVP_DELETE_TRANSACTION_NAVIGATE_BACK_URL); const parentReportAction = useParentReportAction(report); diff --git a/src/pages/inbox/report/ReportActionsView.tsx b/src/pages/inbox/report/ReportActionsView.tsx index 96764eecc23d..c85c87e3f7c3 100755 --- a/src/pages/inbox/report/ReportActionsView.tsx +++ b/src/pages/inbox/report/ReportActionsView.tsx @@ -139,7 +139,7 @@ function ReportActionsView({reportID, onLayout}: ReportActionsViewProps) { [getTransactionThreadReportActions], ); const [transactionThreadReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${transactionThreadReportID}`); - const [isLoadingApp] = useOnyx(ONYXKEYS.IS_LOADING_APP); + const [isLoadingApp] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); const [visibleReportActionsData] = useOnyx(ONYXKEYS.DERIVED.VISIBLE_REPORT_ACTIONS); const prevTransactionThreadReport = usePrevious(transactionThreadReport); const prevReportActionID = usePrevious(reportActionID); diff --git a/src/pages/inbox/report/withReportAndReportActionOrNotFound.tsx b/src/pages/inbox/report/withReportAndReportActionOrNotFound.tsx index 512f85882ed9..485f94b7d6e7 100644 --- a/src/pages/inbox/report/withReportAndReportActionOrNotFound.tsx +++ b/src/pages/inbox/report/withReportAndReportActionOrNotFound.tsx @@ -43,7 +43,7 @@ export default function { if (value !== false) { return; @@ -38,7 +38,7 @@ function BaseSidebarScreen() { const {shouldUseNarrowLayout} = useResponsiveLayout(); const shouldDisplayLHB = !shouldUseNarrowLayout; - const [isLoadingApp = true] = useOnyx(ONYXKEYS.IS_LOADING_APP); + const [isLoadingApp = true] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); const shouldShowSkeleton = isLoadingApp && !hasEverFinishedLoading; // Must be called unconditionally so openApp() can proceed even when diff --git a/src/pages/inbox/sidebar/FABPopoverContent/menuItems/NewWorkspaceMenuItem.tsx b/src/pages/inbox/sidebar/FABPopoverContent/menuItems/NewWorkspaceMenuItem.tsx index 4d660811e6b1..f796a132bf5f 100644 --- a/src/pages/inbox/sidebar/FABPopoverContent/menuItems/NewWorkspaceMenuItem.tsx +++ b/src/pages/inbox/sidebar/FABPopoverContent/menuItems/NewWorkspaceMenuItem.tsx @@ -27,7 +27,7 @@ function NewWorkspaceMenuItem() { const {shouldUseNarrowLayout} = useResponsiveLayout(); const icons = useMemoizedLazyExpensifyIcons(['NewWorkspace']); const {isOffline} = useNetwork(); - const [isLoading = false] = useOnyx(ONYXKEYS.IS_LOADING_APP); + const [isLoading = false] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); const [sessionEmail] = useOnyx(ONYXKEYS.SESSION, {selector: emailSelector}); const [allPolicies] = useMappedPolicies(policyMapper); const {isRestrictedPolicyCreation} = usePreferredPolicy(); diff --git a/src/pages/inbox/sidebar/ProfileAvatarWithIndicator.tsx b/src/pages/inbox/sidebar/ProfileAvatarWithIndicator.tsx index ef3f2e6e0950..799dd44218b9 100644 --- a/src/pages/inbox/sidebar/ProfileAvatarWithIndicator.tsx +++ b/src/pages/inbox/sidebar/ProfileAvatarWithIndicator.tsx @@ -20,7 +20,7 @@ type ProfileAvatarWithIndicatorProps = { function ProfileAvatarWithIndicator({isSelected = false, containerStyles}: ProfileAvatarWithIndicatorProps) { const styles = useThemeStyles(); const currentUserPersonalDetails = useCurrentUserPersonalDetails(); - const [isLoading = true] = useOnyx(ONYXKEYS.IS_LOADING_APP); + const [isLoading = true] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); return ( { ReportActionContextMenu.hideContextMenu(false); diff --git a/src/pages/iou/request/step/withWritableReportOrNotFound.tsx b/src/pages/iou/request/step/withWritableReportOrNotFound.tsx index 3fd755feb219..8dfeb62864b5 100644 --- a/src/pages/iou/request/step/withWritableReportOrNotFound.tsx +++ b/src/pages/iou/request/step/withWritableReportOrNotFound.tsx @@ -71,7 +71,7 @@ export default function ) { const {route} = props; const [report] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${route.params.reportID}`); - const [isLoadingApp = true] = useOnyx(ONYXKEYS.IS_LOADING_APP); + const [isLoadingApp = true] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); const [reportDraft] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_DRAFT}${route.params.reportID}`); const [introSelected] = useOnyx(ONYXKEYS.NVP_INTRO_SELECTED); const [betas] = useOnyx(ONYXKEYS.BETAS); diff --git a/src/pages/media/AttachmentModalScreen/routes/ProfileAvatarModalContent.tsx b/src/pages/media/AttachmentModalScreen/routes/ProfileAvatarModalContent.tsx index 9a79deeb7c8f..1555c1029877 100644 --- a/src/pages/media/AttachmentModalScreen/routes/ProfileAvatarModalContent.tsx +++ b/src/pages/media/AttachmentModalScreen/routes/ProfileAvatarModalContent.tsx @@ -26,7 +26,7 @@ function ProfileAvatarModalContent({navigation, route}: AttachmentModalScreenPro const avatarURL = personalDetail?.avatar ?? ''; const displayName = getDisplayNameOrDefault(personalDetail); - const [isLoadingApp = true] = useOnyx(ONYXKEYS.IS_LOADING_APP); + const [isLoadingApp = true] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); const isLoading = personalDetailsMetadata?.[accountID]?.isLoading ?? (isLoadingApp && !Object.keys(personalDetail ?? {}).length); useEffect(() => { diff --git a/src/pages/media/AttachmentModalScreen/routes/WorkspaceAvatarModalContent.tsx b/src/pages/media/AttachmentModalScreen/routes/WorkspaceAvatarModalContent.tsx index 70fa08ede752..ae798e0c5f8f 100644 --- a/src/pages/media/AttachmentModalScreen/routes/WorkspaceAvatarModalContent.tsx +++ b/src/pages/media/AttachmentModalScreen/routes/WorkspaceAvatarModalContent.tsx @@ -16,7 +16,7 @@ function WorkspaceAvatarModalContent({navigation, route}: AttachmentModalScreenP const defaultAvatars = useDefaultAvatars(); const policy = usePolicy(policyID); - const [isLoadingApp = false] = useOnyx(ONYXKEYS.IS_LOADING_APP, {initWithStoredValues: false}); + const [isLoadingApp = false] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); const avatarURL = policy?.avatarURL ?? getDefaultWorkspaceAvatar(policy?.name ?? fallbackLetter); const source = getFullSizeAvatar({avatarSource: avatarURL, defaultAvatars}); diff --git a/src/pages/media/AttachmentModalScreen/routes/report/ReportAddAttachmentModalContent/index.tsx b/src/pages/media/AttachmentModalScreen/routes/report/ReportAddAttachmentModalContent/index.tsx index 31606deb2f2e..46a64206c4b1 100644 --- a/src/pages/media/AttachmentModalScreen/routes/report/ReportAddAttachmentModalContent/index.tsx +++ b/src/pages/media/AttachmentModalScreen/routes/report/ReportAddAttachmentModalContent/index.tsx @@ -47,7 +47,7 @@ function ReportAddAttachmentModalContent({route, navigation}: AttachmentModalScr const [betas] = useOnyx(ONYXKEYS.BETAS); const isReportArchived = useReportIsArchived(reportID); const canPerformWriteAction = canUserPerformWriteAction(report, isReportArchived); - const [isLoadingApp] = useOnyx(ONYXKEYS.IS_LOADING_APP); + const [isLoadingApp] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); const {isOffline} = useNetwork(); const submitRef = useRef(null); diff --git a/src/pages/media/AttachmentModalScreen/routes/report/ReportAttachmentModalContent.tsx b/src/pages/media/AttachmentModalScreen/routes/report/ReportAttachmentModalContent.tsx index 75600ef3b2b7..7c5cb427faf3 100644 --- a/src/pages/media/AttachmentModalScreen/routes/report/ReportAttachmentModalContent.tsx +++ b/src/pages/media/AttachmentModalScreen/routes/report/ReportAttachmentModalContent.tsx @@ -52,7 +52,7 @@ function ReportAttachmentModalContent({route, navigation}: AttachmentModalScreen useNavigateToReportOnRefresh({source: sourceParam, reportID}); - const [isLoadingApp] = useOnyx(ONYXKEYS.IS_LOADING_APP); + const [isLoadingApp] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); const {isOffline} = useNetwork(); const submitRef = useRef(null); diff --git a/src/pages/media/AttachmentModalScreen/routes/report/ReportAvatarModalContent.tsx b/src/pages/media/AttachmentModalScreen/routes/report/ReportAvatarModalContent.tsx index e64858cd7901..783672cea989 100644 --- a/src/pages/media/AttachmentModalScreen/routes/report/ReportAvatarModalContent.tsx +++ b/src/pages/media/AttachmentModalScreen/routes/report/ReportAvatarModalContent.tsx @@ -18,7 +18,7 @@ function ReportAvatarModalContent({navigation, route}: AttachmentModalScreenProp const defaultAvatars = useDefaultAvatars(); const [report] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${reportID}`); const [policy] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${policyID}`); - const [isLoadingApp = true] = useOnyx(ONYXKEYS.IS_LOADING_APP); + const [isLoadingApp = true] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); const reportAttributes = useReportAttributes(); const attachment: AttachmentModalBaseContentProps = useMemo(() => { diff --git a/src/pages/settings/Profile/Contacts/ContactMethodDetailsPage.tsx b/src/pages/settings/Profile/Contacts/ContactMethodDetailsPage.tsx index b7aaedcf1d21..3a6d475e2d83 100644 --- a/src/pages/settings/Profile/Contacts/ContactMethodDetailsPage.tsx +++ b/src/pages/settings/Profile/Contacts/ContactMethodDetailsPage.tsx @@ -58,7 +58,7 @@ function ContactMethodDetailsPage({route}: ContactMethodDetailsPageProps) { const [session, sessionResult] = useOnyx(ONYXKEYS.SESSION); const [myDomainSecurityGroups, myDomainSecurityGroupsResult] = useOnyx(ONYXKEYS.MY_DOMAIN_SECURITY_GROUPS); const [securityGroups, securityGroupsResult] = useOnyx(ONYXKEYS.COLLECTION.SECURITY_GROUP); - const [isLoadingReportData = true, isLoadingReportDataResult] = useOnyx(ONYXKEYS.IS_LOADING_REPORT_DATA); + const [isLoadingReportData = true, isLoadingReportDataResult] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_REPORT_DATA); const [allPolicies] = useOnyx(ONYXKEYS.COLLECTION.POLICY); const [isValidateCodeFormVisible, setIsValidateCodeFormVisible] = useState(true); const {isActingAsDelegate} = useDelegateNoAccessState(); diff --git a/src/pages/settings/Profile/DisplayNamePage.tsx b/src/pages/settings/Profile/DisplayNamePage.tsx index 6e91420ba2a1..d8ce05d703eb 100644 --- a/src/pages/settings/Profile/DisplayNamePage.tsx +++ b/src/pages/settings/Profile/DisplayNamePage.tsx @@ -41,7 +41,7 @@ const updateDisplayName = ( function DisplayNamePage({currentUserPersonalDetails}: DisplayNamePageProps) { const styles = useThemeStyles(); const {translate, formatPhoneNumber} = useLocalize(); - const [isLoadingApp = true] = useOnyx(ONYXKEYS.IS_LOADING_APP); + const [isLoadingApp = true] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); const currentUserDetails = currentUserPersonalDetails ?? {}; diff --git a/src/pages/settings/Profile/PersonalDetails/BaseLegalNamePage.tsx b/src/pages/settings/Profile/PersonalDetails/BaseLegalNamePage.tsx index c5ac59d1cd3f..444db737eaeb 100644 --- a/src/pages/settings/Profile/PersonalDetails/BaseLegalNamePage.tsx +++ b/src/pages/settings/Profile/PersonalDetails/BaseLegalNamePage.tsx @@ -90,7 +90,7 @@ function BaseLegalNamePage({ defaultLastName, }: BaseLegalNamePageProps) { const [privatePersonalDetails] = useOnyx(ONYXKEYS.PRIVATE_PERSONAL_DETAILS); - const [isLoadingApp = true] = useOnyx(ONYXKEYS.IS_LOADING_APP); + const [isLoadingApp = true] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); const styles = useThemeStyles(); const {translate} = useLocalize(); diff --git a/src/pages/settings/Profile/PersonalDetails/DateOfBirthPage.tsx b/src/pages/settings/Profile/PersonalDetails/DateOfBirthPage.tsx index 12c35854a51b..bd8ce9a8d463 100644 --- a/src/pages/settings/Profile/PersonalDetails/DateOfBirthPage.tsx +++ b/src/pages/settings/Profile/PersonalDetails/DateOfBirthPage.tsx @@ -21,7 +21,7 @@ import INPUT_IDS from '@src/types/form/DateOfBirthForm'; function DateOfBirthPage() { const [privatePersonalDetails] = useOnyx(ONYXKEYS.PRIVATE_PERSONAL_DETAILS); - const [isLoadingApp = true] = useOnyx(ONYXKEYS.IS_LOADING_APP); + const [isLoadingApp = true] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); const {translate} = useLocalize(); const styles = useThemeStyles(); diff --git a/src/pages/settings/Profile/PersonalDetails/PersonalAddressPage.tsx b/src/pages/settings/Profile/PersonalDetails/PersonalAddressPage.tsx index 7f553e3c3d5b..e677cc4587b9 100644 --- a/src/pages/settings/Profile/PersonalDetails/PersonalAddressPage.tsx +++ b/src/pages/settings/Profile/PersonalDetails/PersonalAddressPage.tsx @@ -32,7 +32,7 @@ function updateAddress(values: FormOnyxValues normalizeCountryCode(getCurrentAddress(privatePersonalDetails)) as Address, [privatePersonalDetails]); diff --git a/src/pages/settings/Profile/PersonalDetails/PhoneNumberPage.tsx b/src/pages/settings/Profile/PersonalDetails/PhoneNumberPage.tsx index 46b6f49a7415..8fd4033dfc66 100644 --- a/src/pages/settings/Profile/PersonalDetails/PhoneNumberPage.tsx +++ b/src/pages/settings/Profile/PersonalDetails/PhoneNumberPage.tsx @@ -26,7 +26,7 @@ import type {PrivatePersonalDetails} from '@src/types/onyx'; function PhoneNumberPage() { const [privatePersonalDetails] = useOnyx(ONYXKEYS.PRIVATE_PERSONAL_DETAILS); - const [isLoadingApp = true] = useOnyx(ONYXKEYS.IS_LOADING_APP); + const [isLoadingApp = true] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); const [countryCode = CONST.DEFAULT_COUNTRY_CODE] = useOnyx(ONYXKEYS.COUNTRY_CODE); const styles = useThemeStyles(); const {translate} = useLocalize(); diff --git a/src/pages/settings/Profile/ProfilePage.tsx b/src/pages/settings/Profile/ProfilePage.tsx index 502bc6f6fecf..f2ec7300f197 100755 --- a/src/pages/settings/Profile/ProfilePage.tsx +++ b/src/pages/settings/Profile/ProfilePage.tsx @@ -52,7 +52,7 @@ function ProfilePage() { const currentUserPersonalDetails = useCurrentUserPersonalDetails(); const route = useRoute>(); useDocumentTitle(translate('common.profile')); - const [isLoadingApp] = useOnyx(ONYXKEYS.IS_LOADING_APP); + const [isLoadingApp] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); const getPronouns = (): string => { const pronounsKey = currentUserPersonalDetails?.pronouns?.replace(CONST.PRONOUNS.PREFIX, '') ?? ''; return pronounsKey ? translate(`pronouns.${pronounsKey}` as TranslationPaths) : translate('profilePage.selectYourPronouns'); diff --git a/src/pages/settings/Profile/PronounsPage.tsx b/src/pages/settings/Profile/PronounsPage.tsx index 17201155ca70..db79dd611a7b 100644 --- a/src/pages/settings/Profile/PronounsPage.tsx +++ b/src/pages/settings/Profile/PronounsPage.tsx @@ -26,7 +26,7 @@ type PronounsPageProps = WithCurrentUserPersonalDetailsProps; function PronounsPage({currentUserPersonalDetails}: PronounsPageProps) { const styles = useThemeStyles(); const {translate, localeCompare} = useLocalize(); - const [isLoadingApp = true] = useOnyx(ONYXKEYS.IS_LOADING_APP); + const [isLoadingApp = true] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); const currentPronouns = currentUserPersonalDetails?.pronouns ?? ''; const currentPronounsKey = currentPronouns.substring(CONST.PRONOUNS.PREFIX.length); const [searchValue, setSearchValue] = useState(''); diff --git a/src/pages/settings/Subscription/SubscriptionSettingsPage.tsx b/src/pages/settings/Subscription/SubscriptionSettingsPage.tsx index 5693bbc6871b..3896324336ef 100644 --- a/src/pages/settings/Subscription/SubscriptionSettingsPage.tsx +++ b/src/pages/settings/Subscription/SubscriptionSettingsPage.tsx @@ -34,7 +34,7 @@ function SubscriptionSettingsPage({route}: SubscriptionSettingsPageProps) { useEffect(() => { openSubscriptionPage(); }, []); - const [isAppLoading = true] = useOnyx(ONYXKEYS.IS_LOADING_APP); + const [isAppLoading = true] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); const [amountOwed] = useOnyx(ONYXKEYS.NVP_PRIVATE_AMOUNT_OWED); const shouldShowPage = !!subscriptionPlan || (amountOwed ?? 0) > 0; diff --git a/src/pages/settings/Wallet/WalletPage/index.tsx b/src/pages/settings/Wallet/WalletPage/index.tsx index 7bc6c3ca54ba..de4b8a179bd0 100644 --- a/src/pages/settings/Wallet/WalletPage/index.tsx +++ b/src/pages/settings/Wallet/WalletPage/index.tsx @@ -77,7 +77,7 @@ function WalletPage() { const [userWallet] = useOnyx(ONYXKEYS.USER_WALLET); const [countryByIp] = useOnyx(ONYXKEYS.COUNTRY); const [walletTerms = getEmptyObject()] = useOnyx(ONYXKEYS.WALLET_TERMS); - const [isLoadingApp] = useOnyx(ONYXKEYS.IS_LOADING_APP); + const [isLoadingApp] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); const [userAccount] = useOnyx(ONYXKEYS.ACCOUNT); const [lastUsedPaymentMethods] = useOnyx(ONYXKEYS.NVP_LAST_PAYMENT_METHOD); const [personalPolicyID] = useOnyx(ONYXKEYS.PERSONAL_POLICY_ID); diff --git a/src/pages/workspace/AccessOrNotFoundWrapper.tsx b/src/pages/workspace/AccessOrNotFoundWrapper.tsx index 2a38f0a58292..278ddeef6377 100644 --- a/src/pages/workspace/AccessOrNotFoundWrapper.tsx +++ b/src/pages/workspace/AccessOrNotFoundWrapper.tsx @@ -144,7 +144,7 @@ function AccessOrNotFoundWrapper({ }: AccessOrNotFoundWrapperProps) { const [report] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${reportID}`); const [policy] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${policyID}`); - const [isLoadingReportData = true] = useOnyx(ONYXKEYS.IS_LOADING_REPORT_DATA); + const [isLoadingReportData = true] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_REPORT_DATA); const {login = ''} = useCurrentUserPersonalDetails(); const {isRestrictedToPreferredPolicy} = usePreferredPolicy(); const [betas] = useOnyx(ONYXKEYS.BETAS); diff --git a/src/pages/workspace/WorkspacesListPage.tsx b/src/pages/workspace/WorkspacesListPage.tsx index bad00af642fd..1017d1090749 100755 --- a/src/pages/workspace/WorkspacesListPage.tsx +++ b/src/pages/workspace/WorkspacesListPage.tsx @@ -146,7 +146,7 @@ function WorkspacesListPage() { const [reimbursementAccount] = useOnyx(ONYXKEYS.REIMBURSEMENT_ACCOUNT); const [session] = useOnyx(ONYXKEYS.SESSION); const [activePolicyID] = useOnyx(ONYXKEYS.NVP_ACTIVE_POLICY_ID); - const [isLoadingApp] = useOnyx(ONYXKEYS.IS_LOADING_APP); + const [isLoadingApp] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); const [lastPaymentMethod] = useOnyx(ONYXKEYS.NVP_LAST_PAYMENT_METHOD); const shouldShowLoadingIndicator = isLoadingApp && !isOffline; const route = useRoute>(); diff --git a/src/pages/workspace/expensifyCard/issueNew/AssigneeStep.tsx b/src/pages/workspace/expensifyCard/issueNew/AssigneeStep.tsx index 815e4e82228b..8b7e055d005c 100644 --- a/src/pages/workspace/expensifyCard/issueNew/AssigneeStep.tsx +++ b/src/pages/workspace/expensifyCard/issueNew/AssigneeStep.tsx @@ -47,7 +47,7 @@ function AssigneeStep({policy, stepNames, startStepIndex, route}: AssigneeStepPr const icons = useMemoizedLazyExpensifyIcons(['FallbackAvatar']); const {isOffline} = useNetwork(); const policyID = route.params.policyID; - const [issueNewCard] = useOnyx(`${ONYXKEYS.COLLECTION.ISSUE_NEW_EXPENSIFY_CARD}${policyID}`); + const [issueNewCard] = useOnyx(`${ONYXKEYS.COLLECTION.RAM_ONLY_ISSUE_NEW_EXPENSIFY_CARD}${policyID}`); const [personalDetails] = useOnyx(ONYXKEYS.PERSONAL_DETAILS_LIST); const [account] = useOnyx(ONYXKEYS.ACCOUNT); const [didScreenTransitionEnd, setDidScreenTransitionEnd] = useState(false); diff --git a/src/pages/workspace/expensifyCard/issueNew/CardNameStep.tsx b/src/pages/workspace/expensifyCard/issueNew/CardNameStep.tsx index 0848e753f410..07ce73efac1b 100644 --- a/src/pages/workspace/expensifyCard/issueNew/CardNameStep.tsx +++ b/src/pages/workspace/expensifyCard/issueNew/CardNameStep.tsx @@ -34,7 +34,7 @@ function CardNameStep({policyID, stepNames, startStepIndex}: CardNameStepProps) const {translate} = useLocalize(); const styles = useThemeStyles(); const {inputCallbackRef} = useAutoFocusInput(); - const [issueNewCard] = useOnyx(`${ONYXKEYS.COLLECTION.ISSUE_NEW_EXPENSIFY_CARD}${policyID}`); + const [issueNewCard] = useOnyx(`${ONYXKEYS.COLLECTION.RAM_ONLY_ISSUE_NEW_EXPENSIFY_CARD}${policyID}`); const isEditing = issueNewCard?.isEditing; const data = issueNewCard?.data; diff --git a/src/pages/workspace/expensifyCard/issueNew/CardTypeStep.tsx b/src/pages/workspace/expensifyCard/issueNew/CardTypeStep.tsx index c88c6844a3a9..72675705449e 100644 --- a/src/pages/workspace/expensifyCard/issueNew/CardTypeStep.tsx +++ b/src/pages/workspace/expensifyCard/issueNew/CardTypeStep.tsx @@ -33,7 +33,7 @@ function CardTypeStep({policy, stepNames, startStepIndex}: CardTypeStepProps) { const styles = useThemeStyles(); const illustrations = useMemoizedLazyIllustrations(['HandCard', 'VirtualCard']); const policyID = policy?.id; - const [issueNewCard] = useOnyx(`${ONYXKEYS.COLLECTION.ISSUE_NEW_EXPENSIFY_CARD}${policyID}`); + const [issueNewCard] = useOnyx(`${ONYXKEYS.COLLECTION.RAM_ONLY_ISSUE_NEW_EXPENSIFY_CARD}${policyID}`); const isEditing = issueNewCard?.isEditing; diff --git a/src/pages/workspace/expensifyCard/issueNew/ConfirmationStep.tsx b/src/pages/workspace/expensifyCard/issueNew/ConfirmationStep.tsx index 1a9de688ff4a..5a6c1516abd1 100644 --- a/src/pages/workspace/expensifyCard/issueNew/ConfirmationStep.tsx +++ b/src/pages/workspace/expensifyCard/issueNew/ConfirmationStep.tsx @@ -45,7 +45,7 @@ function ConfirmationStep({policyID, stepNames, startStepIndex, backTo}: Confirm const styles = useThemeStyles(); const {isOffline} = useNetwork(); const [account] = useOnyx(ONYXKEYS.ACCOUNT); - const [issueNewCard] = useOnyx(`${ONYXKEYS.COLLECTION.ISSUE_NEW_EXPENSIFY_CARD}${policyID}`); + const [issueNewCard] = useOnyx(`${ONYXKEYS.COLLECTION.RAM_ONLY_ISSUE_NEW_EXPENSIFY_CARD}${policyID}`); const [policy] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${policyID}`); const defaultFundID = useDefaultFundID(policyID); const {isBetaEnabled} = usePermissions(); diff --git a/src/pages/workspace/expensifyCard/issueNew/InviteNewMemberStep.tsx b/src/pages/workspace/expensifyCard/issueNew/InviteNewMemberStep.tsx index 16aaa18f6caa..813fa306e413 100644 --- a/src/pages/workspace/expensifyCard/issueNew/InviteNewMemberStep.tsx +++ b/src/pages/workspace/expensifyCard/issueNew/InviteNewMemberStep.tsx @@ -22,7 +22,7 @@ type InviteeNewMemberStepProps = Omit { diff --git a/src/pages/workspace/expensifyCard/issueNew/IssueNewCardConfirmMagicCodePage.tsx b/src/pages/workspace/expensifyCard/issueNew/IssueNewCardConfirmMagicCodePage.tsx index b2c2e01fe5d9..242fc4626e02 100644 --- a/src/pages/workspace/expensifyCard/issueNew/IssueNewCardConfirmMagicCodePage.tsx +++ b/src/pages/workspace/expensifyCard/issueNew/IssueNewCardConfirmMagicCodePage.tsx @@ -26,7 +26,7 @@ function IssueNewCardConfirmMagicCodePage({route}: IssueNewCardConfirmMagicCodeP const [account] = useOnyx(ONYXKEYS.ACCOUNT); const [session] = useOnyx(ONYXKEYS.SESSION); const primaryLogin = account?.primaryLogin ?? session?.email ?? ''; - const [issueNewCard] = useOnyx(`${ONYXKEYS.COLLECTION.ISSUE_NEW_EXPENSIFY_CARD}${policyID}`); + const [issueNewCard] = useOnyx(`${ONYXKEYS.COLLECTION.RAM_ONLY_ISSUE_NEW_EXPENSIFY_CARD}${policyID}`); const validateError = getLatestErrorMessageField(issueNewCard); const data = issueNewCard?.data; const isSuccessful = issueNewCard?.isSuccessful; diff --git a/src/pages/workspace/expensifyCard/issueNew/IssueNewCardPage.tsx b/src/pages/workspace/expensifyCard/issueNew/IssueNewCardPage.tsx index ac6bd562bfbe..cc39f988df40 100644 --- a/src/pages/workspace/expensifyCard/issueNew/IssueNewCardPage.tsx +++ b/src/pages/workspace/expensifyCard/issueNew/IssueNewCardPage.tsx @@ -46,7 +46,7 @@ function getStartStepIndex(issueNewCard: OnyxEntry): number { function IssueNewCardPage({policy, route}: IssueNewCardPageProps) { const policyID = policy?.id; - const [issueNewCard] = useOnyx(`${ONYXKEYS.COLLECTION.ISSUE_NEW_EXPENSIFY_CARD}${policyID}`, {initWithStoredValues: false}); + const [issueNewCard] = useOnyx(`${ONYXKEYS.COLLECTION.RAM_ONLY_ISSUE_NEW_EXPENSIFY_CARD}${policyID}`); const {currentStep} = issueNewCard ?? {}; const backTo = route?.params?.backTo; const {isDelegateAccessRestricted} = useDelegateNoAccessState(); diff --git a/src/pages/workspace/expensifyCard/issueNew/LimitTypeStep.tsx b/src/pages/workspace/expensifyCard/issueNew/LimitTypeStep.tsx index 941339de9921..6e634ee2a96c 100644 --- a/src/pages/workspace/expensifyCard/issueNew/LimitTypeStep.tsx +++ b/src/pages/workspace/expensifyCard/issueNew/LimitTypeStep.tsx @@ -38,7 +38,7 @@ function LimitTypeStep({policy, stepNames, startStepIndex}: LimitTypeStepProps) const {translate} = useLocalize(); const styles = useThemeStyles(); const policyID = policy?.id; - const [issueNewCard] = useOnyx(`${ONYXKEYS.COLLECTION.ISSUE_NEW_EXPENSIFY_CARD}${policyID}`); + const [issueNewCard] = useOnyx(`${ONYXKEYS.COLLECTION.RAM_ONLY_ISSUE_NEW_EXPENSIFY_CARD}${policyID}`); const formRef = useRef(null); const areApprovalsConfigured = getApprovalWorkflow(policy) !== CONST.POLICY.APPROVAL_MODE.OPTIONAL; diff --git a/src/pages/workspace/expensifyCard/issueNew/SetExpiryOptionsStep.tsx b/src/pages/workspace/expensifyCard/issueNew/SetExpiryOptionsStep.tsx index 78ad0e1bd6f6..1b49efb79427 100644 --- a/src/pages/workspace/expensifyCard/issueNew/SetExpiryOptionsStep.tsx +++ b/src/pages/workspace/expensifyCard/issueNew/SetExpiryOptionsStep.tsx @@ -33,7 +33,7 @@ function SetExpiryOptionsStep({policy, stepNames, startStepIndex}: SetExpiryOpti const {translate} = useLocalize(); const styles = useThemeStyles(); const policyID = policy?.id; - const [issueNewCard] = useOnyx(`${ONYXKEYS.COLLECTION.ISSUE_NEW_EXPENSIFY_CARD}${policyID}`); + const [issueNewCard] = useOnyx(`${ONYXKEYS.COLLECTION.RAM_ONLY_ISSUE_NEW_EXPENSIFY_CARD}${policyID}`); const personalDetails = usePersonalDetails(); const assigneePersonalDetails = Object.values(personalDetails ?? {}).find((detail) => detail?.login === issueNewCard?.data?.assigneeEmail); diff --git a/src/pages/workspace/withPolicyAndFullscreenLoading.tsx b/src/pages/workspace/withPolicyAndFullscreenLoading.tsx index 83e6399910cc..b7dbb5b7a9c0 100644 --- a/src/pages/workspace/withPolicyAndFullscreenLoading.tsx +++ b/src/pages/workspace/withPolicyAndFullscreenLoading.tsx @@ -33,7 +33,7 @@ export default function withPolicyAndFullscreenLoading) { - const [isLoadingReportData = true] = useOnyx(ONYXKEYS.IS_LOADING_REPORT_DATA); + const [isLoadingReportData = true] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_REPORT_DATA); const [personalDetails] = useOnyx(ONYXKEYS.PERSONAL_DETAILS_LIST); if ((isLoadingPolicy || isLoadingReportData) && isEmpty(policy) && isEmpty(policyDraft)) { diff --git a/src/setup/index.ts b/src/setup/index.ts index 0daed09b2bcb..3ca084804264 100644 --- a/src/setup/index.ts +++ b/src/setup/index.ts @@ -48,7 +48,7 @@ export default function () { [ONYXKEYS.SESSION]: {loading: false}, [ONYXKEYS.ACCOUNT]: CONST.DEFAULT_ACCOUNT_DATA, [ONYXKEYS.NETWORK]: CONST.DEFAULT_NETWORK_DATA, - [ONYXKEYS.IS_SIDEBAR_LOADED]: false, + [ONYXKEYS.RAM_ONLY_IS_SIDEBAR_LOADED]: false, [ONYXKEYS.SHOULD_SHOW_COMPOSE_INPUT]: true, [ONYXKEYS.MODAL]: { isVisible: false, @@ -61,6 +61,12 @@ export default function () { skippableCollectionMemberIDs: CONST.SKIPPABLE_COLLECTION_MEMBER_IDS, snapshotMergeKeys: ['pendingAction', 'pendingFields'], ramOnlyKeys: [ + ONYXKEYS.RAM_ONLY_ARE_TRANSLATIONS_LOADING, + ONYXKEYS.RAM_ONLY_MOBILE_SELECTION_MODE, + ONYXKEYS.RAM_ONLY_IS_SIDEBAR_LOADED, + ONYXKEYS.RAM_ONLY_IS_LOADING_REPORT_DATA, + ONYXKEYS.RAM_ONLY_IS_LOADING_APP, + ONYXKEYS.COLLECTION.RAM_ONLY_ISSUE_NEW_EXPENSIFY_CARD, ONYXKEYS.DERIVED.RAM_ONLY_SORTED_REPORT_ACTIONS, ONYXKEYS.RAM_ONLY_UPDATE_AVAILABLE, ONYXKEYS.RAM_ONLY_UPDATE_REQUIRED, diff --git a/src/types/onyx/UserWallet.ts b/src/types/onyx/UserWallet.ts index eb1b11c7adb0..c67e5b529c37 100644 --- a/src/types/onyx/UserWallet.ts +++ b/src/types/onyx/UserWallet.ts @@ -63,6 +63,9 @@ type UserWallet = { /** The type of setup for adding the bank account */ setupType?: SetupType; + + /** Whether the wallet data is currently being loaded from the server */ + isLoading?: boolean; }; export default UserWallet; diff --git a/tests/actions/QueuedOnyxUpdatesTest.ts b/tests/actions/QueuedOnyxUpdatesTest.ts index d9959d31f6d4..b4b3614f9469 100644 --- a/tests/actions/QueuedOnyxUpdatesTest.ts +++ b/tests/actions/QueuedOnyxUpdatesTest.ts @@ -11,9 +11,9 @@ const queuedOnyxUpdates: Array< | typeof ONYXKEYS.PREFERRED_THEME | typeof ONYXKEYS.NVP_PREFERRED_LOCALE | typeof ONYXKEYS.SESSION - | typeof ONYXKEYS.IS_LOADING_APP + | typeof ONYXKEYS.RAM_ONLY_IS_LOADING_APP | typeof ONYXKEYS.CREDENTIALS - | typeof ONYXKEYS.IS_SIDEBAR_LOADED + | typeof ONYXKEYS.RAM_ONLY_IS_SIDEBAR_LOADED | typeof ONYXKEYS.COLLECTION.REPORT | typeof ONYXKEYS.COLLECTION.REPORT_ACTIONS > @@ -32,7 +32,7 @@ const queuedOnyxUpdates: Array< }, onyxMethod: 'merge', }, - {key: ONYXKEYS.IS_LOADING_APP, value: false, onyxMethod: 'merge'}, + {key: ONYXKEYS.RAM_ONLY_IS_LOADING_APP, value: false, onyxMethod: 'merge'}, { key: ONYXKEYS.CREDENTIALS, value: { @@ -42,7 +42,7 @@ const queuedOnyxUpdates: Array< }, onyxMethod: 'merge', }, - {key: ONYXKEYS.IS_SIDEBAR_LOADED, value: true, onyxMethod: 'merge'}, + {key: ONYXKEYS.RAM_ONLY_IS_SIDEBAR_LOADED, value: true, onyxMethod: 'merge'}, {key: `${ONYXKEYS.COLLECTION.REPORT}2175919089355165`, value: {reportID: 'reportID'}, onyxMethod: 'merge'}, { key: `${ONYXKEYS.COLLECTION.REPORT_ACTIONS}2175919089355165`, @@ -104,9 +104,9 @@ describe('actions/QueuedOnyxUpdates', () => { await testOnyxKeyValue(ONYXKEYS.PREFERRED_THEME); await testOnyxKeyValue(ONYXKEYS.NVP_PREFERRED_LOCALE); await testOnyxKeyValue(ONYXKEYS.SESSION); - await testOnyxKeyValue(ONYXKEYS.IS_LOADING_APP); + await testOnyxKeyValue(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); await testOnyxKeyValue(ONYXKEYS.CREDENTIALS); - await testOnyxKeyValue(ONYXKEYS.IS_SIDEBAR_LOADED); + await testOnyxKeyValue(ONYXKEYS.RAM_ONLY_IS_SIDEBAR_LOADED); await new Promise((resolve) => { const connection = Onyx.connect({ @@ -149,9 +149,9 @@ describe('actions/QueuedOnyxUpdates', () => { await testOnyxKeyValue(ONYXKEYS.PREFERRED_THEME); await testOnyxKeyValue(ONYXKEYS.NVP_PREFERRED_LOCALE); await testOnyxKeyValue(ONYXKEYS.SESSION); - await testOnyxKeyValue(ONYXKEYS.IS_LOADING_APP); + await testOnyxKeyValue(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); await testOnyxKeyValue(ONYXKEYS.CREDENTIALS); - await testOnyxKeyValue(ONYXKEYS.IS_SIDEBAR_LOADED); + await testOnyxKeyValue(ONYXKEYS.RAM_ONLY_IS_SIDEBAR_LOADED); await new Promise((resolve) => { const connection = Onyx.connect({ diff --git a/tests/actions/ReportTest.ts b/tests/actions/ReportTest.ts index 4c2ab3c6c532..6be03c194683 100644 --- a/tests/actions/ReportTest.ts +++ b/tests/actions/ReportTest.ts @@ -3984,7 +3984,7 @@ describe('actions/Report', () => { it('should handle undefined conciergeReportID gracefully', async () => { // Don't set CONCIERGE_REPORT_ID to simulate undefined state - await Onyx.set(ONYXKEYS.IS_LOADING_REPORT_DATA, false); + await Onyx.set(ONYXKEYS.RAM_ONLY_IS_LOADING_REPORT_DATA, false); await waitForBatchedUpdates(); // When conciergeReportID is undefined, the function uses onServerDataReady() @@ -4113,7 +4113,7 @@ describe('actions/Report', () => { }); it('should not throw with any isSelfTourViewed value when conciergeReportID is undefined', async () => { - await Onyx.set(ONYXKEYS.IS_LOADING_REPORT_DATA, false); + await Onyx.set(ONYXKEYS.RAM_ONLY_IS_LOADING_REPORT_DATA, false); await waitForBatchedUpdates(); expect(() => { @@ -4247,7 +4247,7 @@ describe('actions/Report', () => { }); it('should handle undefined conciergeReportID by using fallback navigation', async () => { - await Onyx.set(ONYXKEYS.IS_LOADING_REPORT_DATA, false); + await Onyx.set(ONYXKEYS.RAM_ONLY_IS_LOADING_REPORT_DATA, false); await waitForBatchedUpdates(); expect(() => { diff --git a/tests/perf-test/SidebarLinks.perf-test.tsx b/tests/perf-test/SidebarLinks.perf-test.tsx index 0be24cc82032..e8ce7d087c6b 100644 --- a/tests/perf-test/SidebarLinks.perf-test.tsx +++ b/tests/perf-test/SidebarLinks.perf-test.tsx @@ -80,7 +80,7 @@ describe('SidebarLinks', () => { [ONYXKEYS.PERSONAL_DETAILS_LIST]: LHNTestUtils.fakePersonalDetails, [ONYXKEYS.BETAS]: [CONST.BETAS.DEFAULT_ROOMS], [ONYXKEYS.NVP_PRIORITY_MODE]: CONST.PRIORITY_MODE.GSD, - [ONYXKEYS.IS_LOADING_REPORT_DATA]: false, + [ONYXKEYS.RAM_ONLY_IS_LOADING_REPORT_DATA]: false, ...mockedResponseMap, }); @@ -102,7 +102,7 @@ describe('SidebarLinks', () => { [ONYXKEYS.PERSONAL_DETAILS_LIST]: LHNTestUtils.fakePersonalDetails, [ONYXKEYS.BETAS]: [CONST.BETAS.DEFAULT_ROOMS], [ONYXKEYS.NVP_PRIORITY_MODE]: CONST.PRIORITY_MODE.GSD, - [ONYXKEYS.IS_LOADING_REPORT_DATA]: false, + [ONYXKEYS.RAM_ONLY_IS_LOADING_REPORT_DATA]: false, ...mockedResponseMap, }); diff --git a/tests/ui/AddressPageTest.tsx b/tests/ui/AddressPageTest.tsx index 93e65889bef9..c0287eb9217b 100644 --- a/tests/ui/AddressPageTest.tsx +++ b/tests/ui/AddressPageTest.tsx @@ -66,7 +66,7 @@ describe('AddressPageTest', () => { }, ], }); - await Onyx.merge(`${ONYXKEYS.IS_LOADING_APP}`, false); + await Onyx.merge(`${ONYXKEYS.RAM_ONLY_IS_LOADING_APP}`, false); }); await waitForBatchedUpdatesWithAct(); @@ -96,7 +96,7 @@ describe('AddressPageTest', () => { }, ], }); - await Onyx.merge(`${ONYXKEYS.IS_LOADING_APP}`, false); + await Onyx.merge(`${ONYXKEYS.RAM_ONLY_IS_LOADING_APP}`, false); }); await waitForBatchedUpdatesWithAct(); @@ -118,7 +118,7 @@ describe('AddressPageTest', () => { }, ], }); - await Onyx.merge(`${ONYXKEYS.IS_LOADING_APP}`, false); + await Onyx.merge(`${ONYXKEYS.RAM_ONLY_IS_LOADING_APP}`, false); }); await waitForBatchedUpdatesWithAct(); diff --git a/tests/ui/AuthScreensInitHandlerTest.tsx b/tests/ui/AuthScreensInitHandlerTest.tsx index 9d9197186927..fe9b56b37387 100644 --- a/tests/ui/AuthScreensInitHandlerTest.tsx +++ b/tests/ui/AuthScreensInitHandlerTest.tsx @@ -221,7 +221,7 @@ describe('AuthScreensInitHandler', () => { it('calls handleNetworkReconnect with openApp when isLoadingApp is true', async () => { await Onyx.merge(ONYXKEYS.SESSION, {accountID: TEST_ACCOUNT_ID, email: 'test@test.com'}); - await Onyx.merge(ONYXKEYS.IS_LOADING_APP, true); + await Onyx.merge(ONYXKEYS.RAM_ONLY_IS_LOADING_APP, true); await waitForBatchedUpdates(); renderAuthScreensInitHandler(); @@ -238,7 +238,7 @@ describe('AuthScreensInitHandler', () => { it('calls handleNetworkReconnect with reconnectApp when isLoadingApp is false', async () => { await Onyx.merge(ONYXKEYS.SESSION, {accountID: TEST_ACCOUNT_ID, email: 'test@test.com'}); - await Onyx.merge(ONYXKEYS.IS_LOADING_APP, false); + await Onyx.merge(ONYXKEYS.RAM_ONLY_IS_LOADING_APP, false); await waitForBatchedUpdates(); renderAuthScreensInitHandler(); diff --git a/tests/ui/ForYouSectionTest.tsx b/tests/ui/ForYouSectionTest.tsx index 231acf542c84..18b53dd9651d 100644 --- a/tests/ui/ForYouSectionTest.tsx +++ b/tests/ui/ForYouSectionTest.tsx @@ -105,7 +105,7 @@ describe('ForYouSection', () => { await act(async () => { await Onyx.multiSet({ [ONYXKEYS.SESSION]: {accountID: ACCOUNT_ID, email: 'test@example.com'}, - [ONYXKEYS.IS_LOADING_APP]: false, + [ONYXKEYS.RAM_ONLY_IS_LOADING_APP]: false, }); }); await waitForBatchedUpdatesWithAct(); diff --git a/tests/ui/GroupChatNameTests.tsx b/tests/ui/GroupChatNameTests.tsx index 7bd69524916e..220666d79be2 100644 --- a/tests/ui/GroupChatNameTests.tsx +++ b/tests/ui/GroupChatNameTests.tsx @@ -198,7 +198,7 @@ function signInAndGetApp(reportName = '', participantAccountIDs?: number[]): Pro // Simulate setting an unread report and personal details await act(async () => { await Promise.all([ - Onyx.merge(ONYXKEYS.IS_LOADING_APP, false), + Onyx.merge(ONYXKEYS.RAM_ONLY_IS_LOADING_APP, false), Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT}${REPORT_ID}`, { reportID: REPORT_ID, reportName, diff --git a/tests/ui/LHNItemsPresence.tsx b/tests/ui/LHNItemsPresence.tsx index eb92ed5aa7f9..0f609fb43b89 100644 --- a/tests/ui/LHNItemsPresence.tsx +++ b/tests/ui/LHNItemsPresence.tsx @@ -140,7 +140,7 @@ describe('SidebarLinksData', () => { [ONYXKEYS.NVP_PRIORITY_MODE]: CONST.PRIORITY_MODE.GSD, [ONYXKEYS.BETAS]: betas, [ONYXKEYS.PERSONAL_DETAILS_LIST]: LHNTestUtils.fakePersonalDetails, - [ONYXKEYS.IS_LOADING_APP]: false, + [ONYXKEYS.RAM_ONLY_IS_LOADING_APP]: false, ...(reportData ?? {}), ...(otherData ?? {}), }); diff --git a/tests/ui/PaginationTest.tsx b/tests/ui/PaginationTest.tsx index 630a4c94b355..54686d06a26e 100644 --- a/tests/ui/PaginationTest.tsx +++ b/tests/ui/PaginationTest.tsx @@ -232,7 +232,7 @@ async function signInAndGetApp(): Promise { await act(async () => { await Promise.all([ - Onyx.merge(ONYXKEYS.IS_LOADING_APP, false), + Onyx.merge(ONYXKEYS.RAM_ONLY_IS_LOADING_APP, false), // Simulate setting an unread report and personal details Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT}${REPORT_ID}`, { reportID: REPORT_ID, diff --git a/tests/ui/ProfilePageTest.tsx b/tests/ui/ProfilePageTest.tsx index 599677fecff4..bd270b06dcde 100644 --- a/tests/ui/ProfilePageTest.tsx +++ b/tests/ui/ProfilePageTest.tsx @@ -200,7 +200,7 @@ describe('ProfilePage - SMS domain handling', () => { await act(async () => { await Onyx.merge(ONYXKEYS.PERSONAL_DETAILS_LIST, personalDetails); - await Onyx.merge(ONYXKEYS.IS_LOADING_APP, false); + await Onyx.merge(ONYXKEYS.RAM_ONLY_IS_LOADING_APP, false); }); await waitForBatchedUpdatesWithAct(); @@ -240,7 +240,7 @@ describe('ProfilePage - SMS domain handling', () => { await act(async () => { await Onyx.merge(ONYXKEYS.PERSONAL_DETAILS_LIST, personalDetails); - await Onyx.merge(ONYXKEYS.IS_LOADING_APP, false); + await Onyx.merge(ONYXKEYS.RAM_ONLY_IS_LOADING_APP, false); }); await waitForBatchedUpdatesWithAct(); diff --git a/tests/ui/ReportActionsViewTest.tsx b/tests/ui/ReportActionsViewTest.tsx index a54817dec5fe..9bc7440e0a26 100644 --- a/tests/ui/ReportActionsViewTest.tsx +++ b/tests/ui/ReportActionsViewTest.tsx @@ -196,10 +196,10 @@ describe('ReportActionsView', () => { mockUseReportTransactionsCollection.mockReturnValue({}); mockUseOnyx.mockImplementation((key: string) => { - if (key === ONYXKEYS.IS_LOADING_APP) { + if (key === ONYXKEYS.RAM_ONLY_IS_LOADING_APP) { return [false, {status: 'loaded'}]; } - if (key === ONYXKEYS.ARE_TRANSLATIONS_LOADING) { + if (key === ONYXKEYS.RAM_ONLY_ARE_TRANSLATIONS_LOADING) { return [false, {status: 'loaded'}]; } if (key.includes('reportMetadata')) { @@ -230,10 +230,10 @@ describe('ReportActionsView', () => { }); mockUseOnyx.mockImplementation((key: string) => { - if (key === ONYXKEYS.IS_LOADING_APP) { + if (key === ONYXKEYS.RAM_ONLY_IS_LOADING_APP) { return [true, {status: 'loaded'}]; } - if (key === ONYXKEYS.ARE_TRANSLATIONS_LOADING) { + if (key === ONYXKEYS.RAM_ONLY_ARE_TRANSLATIONS_LOADING) { return [false, {status: 'loaded'}]; } if (key.includes('reportMetadata')) { @@ -267,10 +267,10 @@ describe('ReportActionsView', () => { }); mockUseOnyx.mockImplementation((key: string) => { - if (key === ONYXKEYS.IS_LOADING_APP) { + if (key === ONYXKEYS.RAM_ONLY_IS_LOADING_APP) { return [false, {status: 'loaded'}]; } - if (key === ONYXKEYS.ARE_TRANSLATIONS_LOADING) { + if (key === ONYXKEYS.RAM_ONLY_ARE_TRANSLATIONS_LOADING) { return [false, {status: 'loaded'}]; } if (key.includes('reportMetadata')) { @@ -299,10 +299,10 @@ describe('ReportActionsView', () => { }); mockUseOnyx.mockImplementation((key: string) => { - if (key === ONYXKEYS.IS_LOADING_APP) { + if (key === ONYXKEYS.RAM_ONLY_IS_LOADING_APP) { return [true, {status: 'loaded'}]; } - if (key === ONYXKEYS.ARE_TRANSLATIONS_LOADING) { + if (key === ONYXKEYS.RAM_ONLY_ARE_TRANSLATIONS_LOADING) { return [false, {status: 'loaded'}]; } if (key.includes('reportMetadata')) { @@ -331,10 +331,10 @@ describe('ReportActionsView', () => { }); mockUseOnyx.mockImplementation((key: string) => { - if (key === ONYXKEYS.IS_LOADING_APP) { + if (key === ONYXKEYS.RAM_ONLY_IS_LOADING_APP) { return [false, {status: 'loaded'}]; } - if (key === ONYXKEYS.ARE_TRANSLATIONS_LOADING) { + if (key === ONYXKEYS.RAM_ONLY_ARE_TRANSLATIONS_LOADING) { return [false, {status: 'loaded'}]; } if (key.includes('reportMetadata')) { @@ -397,10 +397,10 @@ describe('ReportActionsView', () => { if (key === ONYXKEYS.CONCIERGE_REPORT_ID) { return [CONCIERGE_REPORT_ID, {status: 'loaded'}]; } - if (key === ONYXKEYS.IS_LOADING_APP) { + if (key === ONYXKEYS.RAM_ONLY_IS_LOADING_APP) { return [false, {status: 'loaded'}]; } - if (key === ONYXKEYS.ARE_TRANSLATIONS_LOADING) { + if (key === ONYXKEYS.RAM_ONLY_ARE_TRANSLATIONS_LOADING) { return [false, {status: 'loaded'}]; } if (key.includes('reportMetadata')) { diff --git a/tests/ui/ReportAttachments.tsx b/tests/ui/ReportAttachments.tsx index 7aae70f2e69c..a8101deeff9e 100644 --- a/tests/ui/ReportAttachments.tsx +++ b/tests/ui/ReportAttachments.tsx @@ -149,7 +149,7 @@ describe('ReportAttachments', () => { global.fetch = getGlobalFetchMock(); wrapOnyxWithWaitForBatchedUpdates(Onyx); await act(async () => { - await Onyx.merge(ONYXKEYS.IS_LOADING_APP, false); + await Onyx.merge(ONYXKEYS.RAM_ONLY_IS_LOADING_APP, false); }); await waitForBatchedUpdatesWithAct(); diff --git a/tests/ui/SessionTest.tsx b/tests/ui/SessionTest.tsx index 7c2ea776385b..476755d398e6 100644 --- a/tests/ui/SessionTest.tsx +++ b/tests/ui/SessionTest.tsx @@ -94,7 +94,7 @@ describe('Deep linking', () => { jest.spyOn(AppActions, 'openApp').mockImplementation(async () => { const originalResult = await originalOpenApp(); await Onyx.set(`${ONYXKEYS.COLLECTION.REPORT}${report.reportID}`, report); - await Onyx.merge(ONYXKEYS.IS_LOADING_APP, false); + await Onyx.merge(ONYXKEYS.RAM_ONLY_IS_LOADING_APP, false); return originalResult; }); }); diff --git a/tests/ui/UnreadIndicatorsTest.tsx b/tests/ui/UnreadIndicatorsTest.tsx index d1af4839f23b..2229d33840c6 100644 --- a/tests/ui/UnreadIndicatorsTest.tsx +++ b/tests/ui/UnreadIndicatorsTest.tsx @@ -214,7 +214,7 @@ async function signInAndGetAppWithUnreadChat(): Promise { }; await Promise.all([ - Onyx.merge(ONYXKEYS.IS_LOADING_APP, false), + Onyx.merge(ONYXKEYS.RAM_ONLY_IS_LOADING_APP, false), Onyx.merge(ONYXKEYS.PERSONAL_DETAILS_LIST, personalDetails), Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT}${REPORT_ID}`, report), Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${REPORT_ID}`, reportActions), diff --git a/tests/ui/WorkspaceWorkflowsApprovalsEditPageTest.tsx b/tests/ui/WorkspaceWorkflowsApprovalsEditPageTest.tsx index ef462e550190..cc95606c447c 100644 --- a/tests/ui/WorkspaceWorkflowsApprovalsEditPageTest.tsx +++ b/tests/ui/WorkspaceWorkflowsApprovalsEditPageTest.tsx @@ -96,7 +96,7 @@ describe('WorkspaceWorkflowsApprovalsEditPage', () => { await act(async () => { await Onyx.clear(); await Onyx.set(ONYXKEYS.HAS_LOADED_APP, true); - await Onyx.set(ONYXKEYS.IS_LOADING_REPORT_DATA, false); + await Onyx.set(ONYXKEYS.RAM_ONLY_IS_LOADING_REPORT_DATA, false); const policy = buildPolicy(); const personalDetails = buildPersonalDetailsList(); diff --git a/tests/ui/components/ProductTrainingContextProvider.tsx b/tests/ui/components/ProductTrainingContextProvider.tsx index 81791f0dc121..a8b36c90248d 100644 --- a/tests/ui/components/ProductTrainingContextProvider.tsx +++ b/tests/ui/components/ProductTrainingContextProvider.tsx @@ -66,7 +66,7 @@ describe('ProductTrainingContextProvider', () => { // Set up test environment before each test wrapOnyxWithWaitForBatchedUpdates(Onyx); Onyx.merge(ONYXKEYS.NETWORK, {isOffline: false}); - Onyx.merge(ONYXKEYS.IS_LOADING_APP, false); + Onyx.merge(ONYXKEYS.RAM_ONLY_IS_LOADING_APP, false); signUpWithTestUser(); }); @@ -82,7 +82,7 @@ describe('ProductTrainingContextProvider', () => { describe('Basic Tooltip Registration', () => { it('should not register tooltips when app is loading', async () => { // When app is loading - Onyx.merge(ONYXKEYS.IS_LOADING_APP, true); + Onyx.merge(ONYXKEYS.RAM_ONLY_IS_LOADING_APP, true); await waitForBatchedUpdatesWithAct(); const testTooltip = CONST.PRODUCT_TRAINING_TOOLTIP_NAMES.SCAN_TEST_TOOLTIP; diff --git a/tests/unit/ContactMethodDetailsPageTest.tsx b/tests/unit/ContactMethodDetailsPageTest.tsx index 5ab3fc7a6e26..81552509fd9a 100644 --- a/tests/unit/ContactMethodDetailsPageTest.tsx +++ b/tests/unit/ContactMethodDetailsPageTest.tsx @@ -134,7 +134,7 @@ describe('ContactMethodDetailsPage', () => { it('calls Navigation.goBack when contact method becomes validated and screen is focused', async () => { Onyx.merge(ONYXKEYS.SESSION, {email: fakeEmail}); - Onyx.merge(ONYXKEYS.IS_LOADING_REPORT_DATA, false); + Onyx.merge(ONYXKEYS.RAM_ONLY_IS_LOADING_REPORT_DATA, false); Onyx.merge(ONYXKEYS.LOGIN_LIST, { [fakeEmail]: { partnerName: 'expensify.com', diff --git a/tests/unit/LocalizeTests.ts b/tests/unit/LocalizeTests.ts index dc84bec2c1ac..b97d26ca4283 100644 --- a/tests/unit/LocalizeTests.ts +++ b/tests/unit/LocalizeTests.ts @@ -56,7 +56,7 @@ describe('localize', () => { Onyx.init({ keys: { NVP_PREFERRED_LOCALE: ONYXKEYS.NVP_PREFERRED_LOCALE, - ARE_TRANSLATIONS_LOADING: ONYXKEYS.ARE_TRANSLATIONS_LOADING, + ARE_TRANSLATIONS_LOADING: ONYXKEYS.RAM_ONLY_ARE_TRANSLATIONS_LOADING, SESSION: ONYXKEYS.SESSION, }, }); diff --git a/tests/unit/OnyxDerivedTest.tsx b/tests/unit/OnyxDerivedTest.tsx index f3d974cf974c..142bad735f98 100644 --- a/tests/unit/OnyxDerivedTest.tsx +++ b/tests/unit/OnyxDerivedTest.tsx @@ -38,7 +38,7 @@ describe('OnyxDerived', () => { beforeEach(async () => { // The reportAttributes locale connection uses initWithStoredValues: false, // so it doesn't fire after Onyx.clear(). Setting this triggers recomputation. - await Onyx.set(ONYXKEYS.ARE_TRANSLATIONS_LOADING, false); + await Onyx.set(ONYXKEYS.RAM_ONLY_ARE_TRANSLATIONS_LOADING, false); await waitForBatchedUpdates(); }); diff --git a/tests/unit/ReportActionItemSingleTest.ts b/tests/unit/ReportActionItemSingleTest.ts index 8d400c96b510..3115a9c7cc77 100644 --- a/tests/unit/ReportActionItemSingleTest.ts +++ b/tests/unit/ReportActionItemSingleTest.ts @@ -56,7 +56,7 @@ describe('ReportActionItemSingle', () => { await act(async () => { await Onyx.multiSet({ [ONYXKEYS.PERSONAL_DETAILS_LIST]: fakePersonalDetails, - [ONYXKEYS.IS_LOADING_REPORT_DATA]: false, + [ONYXKEYS.RAM_ONLY_IS_LOADING_REPORT_DATA]: false, [ONYXKEYS.COLLECTION.REPORT_ACTIONS]: { [`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${fakeReport.reportID}`]: { [fakeReportAction.reportActionID]: fakeReportAction, diff --git a/tests/unit/SidebarOrderTest.ts b/tests/unit/SidebarOrderTest.ts index 6ab60e5f9946..3d2af7271693 100644 --- a/tests/unit/SidebarOrderTest.ts +++ b/tests/unit/SidebarOrderTest.ts @@ -95,7 +95,7 @@ describe('Sidebar', () => { .then(() => Onyx.multiSet({ [ONYXKEYS.PERSONAL_DETAILS_LIST]: LHNTestUtils.fakePersonalDetails, - [ONYXKEYS.IS_LOADING_APP]: false, + [ONYXKEYS.RAM_ONLY_IS_LOADING_APP]: false, }), ) @@ -122,7 +122,7 @@ describe('Sidebar', () => { Onyx.multiSet({ [ONYXKEYS.NVP_PRIORITY_MODE]: CONST.PRIORITY_MODE.DEFAULT, [ONYXKEYS.PERSONAL_DETAILS_LIST]: LHNTestUtils.fakePersonalDetails, - [ONYXKEYS.IS_LOADING_APP]: false, + [ONYXKEYS.RAM_ONLY_IS_LOADING_APP]: false, ...reportCollectionDataSet, }), ) @@ -160,7 +160,7 @@ describe('Sidebar', () => { Onyx.multiSet({ [ONYXKEYS.NVP_PRIORITY_MODE]: CONST.PRIORITY_MODE.DEFAULT, [ONYXKEYS.PERSONAL_DETAILS_LIST]: LHNTestUtils.fakePersonalDetails, - [ONYXKEYS.IS_LOADING_APP]: false, + [ONYXKEYS.RAM_ONLY_IS_LOADING_APP]: false, ...reportCollectionDataSet, }), ) @@ -209,7 +209,7 @@ describe('Sidebar', () => { Onyx.multiSet({ [ONYXKEYS.NVP_PRIORITY_MODE]: CONST.PRIORITY_MODE.DEFAULT, [ONYXKEYS.PERSONAL_DETAILS_LIST]: LHNTestUtils.fakePersonalDetails, - [ONYXKEYS.IS_LOADING_APP]: false, + [ONYXKEYS.RAM_ONLY_IS_LOADING_APP]: false, [`${ONYXKEYS.COLLECTION.REPORT_DRAFT_COMMENT}${report1.reportID}`]: 'report1 draft', ...reportCollectionDataSet, }), @@ -256,7 +256,7 @@ describe('Sidebar', () => { Onyx.multiSet({ [ONYXKEYS.NVP_PRIORITY_MODE]: CONST.PRIORITY_MODE.DEFAULT, [ONYXKEYS.PERSONAL_DETAILS_LIST]: LHNTestUtils.fakePersonalDetails, - [ONYXKEYS.IS_LOADING_APP]: false, + [ONYXKEYS.RAM_ONLY_IS_LOADING_APP]: false, ...reportCollectionDataSet, }), ) @@ -319,7 +319,7 @@ describe('Sidebar', () => { Onyx.multiSet({ [ONYXKEYS.NVP_PRIORITY_MODE]: CONST.PRIORITY_MODE.DEFAULT, [ONYXKEYS.PERSONAL_DETAILS_LIST]: LHNTestUtils.fakePersonalDetails, - [ONYXKEYS.IS_LOADING_APP]: false, + [ONYXKEYS.RAM_ONLY_IS_LOADING_APP]: false, ...reportCollectionDataSet, }), ) @@ -393,7 +393,7 @@ describe('Sidebar', () => { Onyx.multiSet({ [ONYXKEYS.NVP_PRIORITY_MODE]: CONST.PRIORITY_MODE.DEFAULT, [ONYXKEYS.PERSONAL_DETAILS_LIST]: LHNTestUtils.fakePersonalDetails, - [ONYXKEYS.IS_LOADING_APP]: false, + [ONYXKEYS.RAM_ONLY_IS_LOADING_APP]: false, ...reportCollectionDataSet, }), ) @@ -472,7 +472,7 @@ describe('Sidebar', () => { Onyx.multiSet({ [ONYXKEYS.NVP_PRIORITY_MODE]: CONST.PRIORITY_MODE.DEFAULT, [ONYXKEYS.PERSONAL_DETAILS_LIST]: LHNTestUtils.fakePersonalDetails, - [ONYXKEYS.IS_LOADING_APP]: false, + [ONYXKEYS.RAM_ONLY_IS_LOADING_APP]: false, [`${ONYXKEYS.COLLECTION.POLICY}${fakeReport.policyID}`]: fakePolicy, ...reportCollectionDataSet, }), @@ -523,7 +523,7 @@ describe('Sidebar', () => { Onyx.multiSet({ [ONYXKEYS.NVP_PRIORITY_MODE]: CONST.PRIORITY_MODE.DEFAULT, [ONYXKEYS.PERSONAL_DETAILS_LIST]: LHNTestUtils.fakePersonalDetails, - [ONYXKEYS.IS_LOADING_APP]: false, + [ONYXKEYS.RAM_ONLY_IS_LOADING_APP]: false, [ONYXKEYS.COLLECTION.REPORT_DRAFT_COMMENT + report2.reportID]: 'This is a draft', ...reportCollectionDataSet, }), @@ -570,7 +570,7 @@ describe('Sidebar', () => { Onyx.multiSet({ [ONYXKEYS.NVP_PRIORITY_MODE]: CONST.PRIORITY_MODE.DEFAULT, [ONYXKEYS.PERSONAL_DETAILS_LIST]: LHNTestUtils.fakePersonalDetails, - [ONYXKEYS.IS_LOADING_APP]: false, + [ONYXKEYS.RAM_ONLY_IS_LOADING_APP]: false, [`${ONYXKEYS.COLLECTION.REPORT_DRAFT_COMMENT}${report.reportID}`]: 'This is a draft', ...reportCollectionDataSet, }), @@ -612,7 +612,7 @@ describe('Sidebar', () => { Onyx.multiSet({ [ONYXKEYS.NVP_PRIORITY_MODE]: CONST.PRIORITY_MODE.DEFAULT, [ONYXKEYS.PERSONAL_DETAILS_LIST]: LHNTestUtils.fakePersonalDetails, - [ONYXKEYS.IS_LOADING_APP]: false, + [ONYXKEYS.RAM_ONLY_IS_LOADING_APP]: false, ...reportCollectionDataSet, }), ) @@ -696,7 +696,7 @@ describe('Sidebar', () => { Onyx.multiSet({ [ONYXKEYS.NVP_PRIORITY_MODE]: CONST.PRIORITY_MODE.DEFAULT, [ONYXKEYS.PERSONAL_DETAILS_LIST]: LHNTestUtils.fakePersonalDetails, - [ONYXKEYS.IS_LOADING_APP]: false, + [ONYXKEYS.RAM_ONLY_IS_LOADING_APP]: false, [`${ONYXKEYS.COLLECTION.REPORT_DRAFT_COMMENT}${report2.reportID}`]: 'Report2 draft comment', ...reportCollectionDataSet, }), @@ -754,7 +754,7 @@ describe('Sidebar', () => { Onyx.multiSet({ [ONYXKEYS.NVP_PRIORITY_MODE]: CONST.PRIORITY_MODE.DEFAULT, [ONYXKEYS.PERSONAL_DETAILS_LIST]: LHNTestUtils.fakePersonalDetails, - [ONYXKEYS.IS_LOADING_APP]: false, + [ONYXKEYS.RAM_ONLY_IS_LOADING_APP]: false, ...reportCollectionDataSet, }), ) @@ -816,7 +816,7 @@ describe('Sidebar', () => { Onyx.multiSet({ [ONYXKEYS.NVP_PRIORITY_MODE]: CONST.PRIORITY_MODE.DEFAULT, [ONYXKEYS.PERSONAL_DETAILS_LIST]: LHNTestUtils.fakePersonalDetails, - [ONYXKEYS.IS_LOADING_APP]: false, + [ONYXKEYS.RAM_ONLY_IS_LOADING_APP]: false, ...reportDraftCommentCollectionDataSet, ...reportCollectionDataSet, }), @@ -888,7 +888,7 @@ describe('Sidebar', () => { [ONYXKEYS.BETAS]: betas, [ONYXKEYS.NVP_PRIORITY_MODE]: CONST.PRIORITY_MODE.DEFAULT, [ONYXKEYS.PERSONAL_DETAILS_LIST]: LHNTestUtils.fakePersonalDetails, - [ONYXKEYS.IS_LOADING_APP]: false, + [ONYXKEYS.RAM_ONLY_IS_LOADING_APP]: false, ...reportNameValuePairsCollectionDataSet, ...reportCollectionDataSet, }), @@ -932,7 +932,7 @@ describe('Sidebar', () => { Onyx.multiSet({ [ONYXKEYS.NVP_PRIORITY_MODE]: CONST.PRIORITY_MODE.DEFAULT, [ONYXKEYS.PERSONAL_DETAILS_LIST]: LHNTestUtils.fakePersonalDetails, - [ONYXKEYS.IS_LOADING_APP]: false, + [ONYXKEYS.RAM_ONLY_IS_LOADING_APP]: false, ...reportCollectionDataSet, }), ) @@ -972,7 +972,7 @@ describe('Sidebar', () => { .then(() => Onyx.multiSet({ [ONYXKEYS.NVP_PRIORITY_MODE]: CONST.PRIORITY_MODE.GSD, - [ONYXKEYS.IS_LOADING_APP]: false, + [ONYXKEYS.RAM_ONLY_IS_LOADING_APP]: false, ...reportCollectionDataSet, }), ) @@ -1035,7 +1035,7 @@ describe('Sidebar', () => { [ONYXKEYS.BETAS]: betas, [ONYXKEYS.NVP_PRIORITY_MODE]: CONST.PRIORITY_MODE.GSD, [ONYXKEYS.PERSONAL_DETAILS_LIST]: LHNTestUtils.fakePersonalDetails, - [ONYXKEYS.IS_LOADING_APP]: false, + [ONYXKEYS.RAM_ONLY_IS_LOADING_APP]: false, ...reportNameValuePairsCollectionDataSet, ...reportCollectionDataSet, }), diff --git a/tests/unit/SidebarTest.ts b/tests/unit/SidebarTest.ts index 2c8d3c6e8206..81940ec35630 100644 --- a/tests/unit/SidebarTest.ts +++ b/tests/unit/SidebarTest.ts @@ -95,7 +95,7 @@ describe('Sidebar', () => { [ONYXKEYS.BETAS]: betas, [ONYXKEYS.NVP_PRIORITY_MODE]: CONST.PRIORITY_MODE.GSD, [ONYXKEYS.PERSONAL_DETAILS_LIST]: LHNTestUtils.fakePersonalDetails, - [ONYXKEYS.IS_LOADING_APP]: false, + [ONYXKEYS.RAM_ONLY_IS_LOADING_APP]: false, ...reportNameValuePairsCollection, ...reportCollection, ...reportAction, @@ -158,7 +158,7 @@ describe('Sidebar', () => { [ONYXKEYS.BETAS]: betas, [ONYXKEYS.NVP_PRIORITY_MODE]: CONST.PRIORITY_MODE.GSD, [ONYXKEYS.PERSONAL_DETAILS_LIST]: LHNTestUtils.fakePersonalDetails, - [ONYXKEYS.IS_LOADING_APP]: false, + [ONYXKEYS.RAM_ONLY_IS_LOADING_APP]: false, ...reportNameValuePairsCollection, ...reportCollection, ...reportAction, From 30bd158ca8201a6f4c82cd5b1d81773db49cdc56 Mon Sep 17 00:00:00 2001 From: Julian Kobrynski Date: Tue, 7 Apr 2026 19:41:20 +0200 Subject: [PATCH 2/6] Revert IS_LOADING_APP RAM-only migration to fix LHN infinite loading on offline refresh --- Mobile-Expensify | 2 +- src/DelegateAccessHandler.tsx | 2 +- src/ONYXKEYS.ts | 4 +-- .../MoneyRequestReportView.tsx | 2 +- .../ProductTrainingContext/index.tsx | 2 +- src/hooks/useOnboardingFlow.ts | 2 +- .../AppNavigator/AuthScreensInitHandler.tsx | 4 +-- src/libs/Navigation/guards/index.ts | 2 +- src/libs/actions/App.ts | 14 ++++---- src/libs/actions/OnyxUpdateManager/index.ts | 2 +- src/libs/actions/QueuedOnyxUpdates.ts | 2 +- src/pages/NewReportWorkspaceSelectionPage.tsx | 2 +- .../ReimbursementAccountPage.tsx | 2 +- src/pages/ReportChangeWorkspacePage.tsx | 2 +- .../SearchFiltersWorkspacePage.tsx | 2 +- .../Search/SearchMoneyRequestReportPage.tsx | 2 +- src/pages/SetDefaultWorkspacePage.tsx | 2 +- src/pages/home/ForYouSection/index.tsx | 2 +- src/pages/home/HomePage.tsx | 2 +- src/pages/inbox/ReportFetchHandler.tsx | 2 +- src/pages/inbox/ReportNotFoundGuard.tsx | 2 +- src/pages/inbox/report/ReportActionsView.tsx | 2 +- src/pages/inbox/sidebar/BaseSidebarScreen.tsx | 4 +-- .../menuItems/NewWorkspaceMenuItem.tsx | 2 +- .../sidebar/ProfileAvatarWithIndicator.tsx | 2 +- .../step/withWritableReportOrNotFound.tsx | 2 +- .../routes/ProfileAvatarModalContent.tsx | 2 +- .../routes/WorkspaceAvatarModalContent.tsx | 2 +- .../ReportAddAttachmentModalContent/index.tsx | 2 +- .../report/ReportAttachmentModalContent.tsx | 2 +- .../report/ReportAvatarModalContent.tsx | 2 +- .../settings/Profile/DisplayNamePage.tsx | 2 +- .../PersonalDetails/BaseLegalNamePage.tsx | 2 +- .../PersonalDetails/DateOfBirthPage.tsx | 2 +- .../PersonalDetails/PersonalAddressPage.tsx | 2 +- .../PersonalDetails/PhoneNumberPage.tsx | 2 +- src/pages/settings/Profile/ProfilePage.tsx | 2 +- src/pages/settings/Profile/PronounsPage.tsx | 2 +- .../Subscription/SubscriptionSettingsPage.tsx | 2 +- .../settings/Wallet/WalletPage/index.tsx | 2 +- src/pages/workspace/WorkspacesListPage.tsx | 2 +- src/setup/index.ts | 1 - tests/actions/QueuedOnyxUpdatesTest.ts | 8 ++--- tests/ui/AddressPageTest.tsx | 6 ++-- tests/ui/AuthScreensInitHandlerTest.tsx | 4 +-- tests/ui/ForYouSectionTest.tsx | 2 +- tests/ui/GroupChatNameTests.tsx | 2 +- tests/ui/LHNItemsPresence.tsx | 2 +- tests/ui/PaginationTest.tsx | 2 +- tests/ui/ProfilePageTest.tsx | 4 +-- tests/ui/ReportActionsViewTest.tsx | 12 +++---- tests/ui/ReportAttachments.tsx | 2 +- tests/ui/SessionTest.tsx | 2 +- tests/ui/UnreadIndicatorsTest.tsx | 2 +- .../ProductTrainingContextProvider.tsx | 4 +-- tests/unit/SidebarOrderTest.ts | 36 +++++++++---------- tests/unit/SidebarTest.ts | 4 +-- 57 files changed, 96 insertions(+), 97 deletions(-) diff --git a/Mobile-Expensify b/Mobile-Expensify index 9989e3374533..9897949edd74 160000 --- a/Mobile-Expensify +++ b/Mobile-Expensify @@ -1 +1 @@ -Subproject commit 9989e3374533c0530e8895558a0bdd836594e2da +Subproject commit 9897949edd74125de3d8445f2df6107223719318 diff --git a/src/DelegateAccessHandler.tsx b/src/DelegateAccessHandler.tsx index e1477201bd7c..b3683c672cf9 100644 --- a/src/DelegateAccessHandler.tsx +++ b/src/DelegateAccessHandler.tsx @@ -22,7 +22,7 @@ function DelegateAccessHandler() { const [stashedCredentials = CONST.EMPTY_OBJECT] = useOnyx(ONYXKEYS.STASHED_CREDENTIALS); const [stashedSession] = useOnyx(ONYXKEYS.STASHED_SESSION); const [hasLoadedApp] = useOnyx(ONYXKEYS.HAS_LOADED_APP); - const [isLoadingApp] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); + const [isLoadingApp] = useOnyx(ONYXKEYS.IS_LOADING_APP); const [sessionAccountID] = useOnyx(ONYXKEYS.SESSION, {selector: accountIDSelector}); const [sessionEmail] = useOnyx(ONYXKEYS.SESSION, {selector: emailSelector}); const {isOffline} = useNetwork(); diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index a40f170a5f5b..08fe90189696 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -382,7 +382,7 @@ const ONYXKEYS = { IS_LOADING_BULK_CHANGE_APPROVER_PAGE: 'isLoadingBulkChangeApproverPage', /** Is report data loading? */ - RAM_ONLY_IS_LOADING_APP: 'isLoadingApp', + IS_LOADING_APP: 'isLoadingApp', /** Is loading policy rules preview? */ IS_LOADING_POLICY_CODING_RULES_PREVIEW: 'isLoadingPolicyCodingRulesPreview', @@ -1404,7 +1404,7 @@ type OnyxValuesMapping = { [ONYXKEYS.IS_LOADING_SUBSCRIPTION_DATA]: boolean; [ONYXKEYS.IS_SEARCH_PAGE_DATA_LOADED]: boolean; [ONYXKEYS.IS_TEST_TOOLS_MODAL_OPEN]: boolean; - [ONYXKEYS.RAM_ONLY_IS_LOADING_APP]: boolean; + [ONYXKEYS.IS_LOADING_APP]: boolean; [ONYXKEYS.HAS_LOADED_APP]: boolean; [ONYXKEYS.WALLET_TRANSFER]: OnyxTypes.WalletTransfer; [ONYXKEYS.LAST_ACCESSED_WORKSPACE_POLICY_ID]: string; diff --git a/src/components/MoneyRequestReportView/MoneyRequestReportView.tsx b/src/components/MoneyRequestReportView/MoneyRequestReportView.tsx index 1a5688c13721..a4c1b2bfda36 100644 --- a/src/components/MoneyRequestReportView/MoneyRequestReportView.tsx +++ b/src/components/MoneyRequestReportView/MoneyRequestReportView.tsx @@ -116,7 +116,7 @@ function MoneyRequestReportView({report, policy, reportMetadata, shouldDisplayRe const {isSmallScreenWidth} = useResponsiveLayout(); const reportID = report?.reportID; - const [isLoadingApp] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); + const [isLoadingApp] = useOnyx(ONYXKEYS.IS_LOADING_APP); const {reportPendingAction, reportErrors} = getReportOfflinePendingActionAndErrors(report); const [chatReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${getNonEmptyStringOnyxID(report?.chatReportID)}`); diff --git a/src/components/ProductTrainingContext/index.tsx b/src/components/ProductTrainingContext/index.tsx index f8c07182a4d4..100eb568e8dd 100644 --- a/src/components/ProductTrainingContext/index.tsx +++ b/src/components/ProductTrainingContext/index.tsx @@ -54,7 +54,7 @@ const ProductTrainingContext = createContext({ }); function ProductTrainingContextProvider({children}: ChildrenProps) { - const [isLoadingApp = true] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); + const [isLoadingApp = true] = useOnyx(ONYXKEYS.IS_LOADING_APP); const [tryNewDot] = useOnyx(ONYXKEYS.NVP_TRY_NEW_DOT); const hasBeenAddedToNudgeMigration = !!tryNewDot?.nudgeMigration?.timestamp; const [isOnboardingCompleted = true, isOnboardingCompletedMetadata] = useOnyx(ONYXKEYS.NVP_ONBOARDING, { diff --git a/src/hooks/useOnboardingFlow.ts b/src/hooks/useOnboardingFlow.ts index c051b4d90063..0a70def30062 100644 --- a/src/hooks/useOnboardingFlow.ts +++ b/src/hooks/useOnboardingFlow.ts @@ -19,7 +19,7 @@ import useOnyx from './useOnyx'; */ function useOnboardingFlowRouter() { const currentUrl = getCurrentUrl(); - const [isLoadingApp = true] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); + const [isLoadingApp = true] = useOnyx(ONYXKEYS.IS_LOADING_APP); const [onboardingValues, isOnboardingCompletedMetadata] = useOnyx(ONYXKEYS.NVP_ONBOARDING); const [sessionEmail] = useOnyx(ONYXKEYS.SESSION, {selector: emailSelector}); const isLoggingInAsNewSessionUser = isLoggingInAsNewUser(currentUrl, sessionEmail); diff --git a/src/libs/Navigation/AppNavigator/AuthScreensInitHandler.tsx b/src/libs/Navigation/AppNavigator/AuthScreensInitHandler.tsx index fa1a09f60e4c..ee2d18c3e942 100644 --- a/src/libs/Navigation/AppNavigator/AuthScreensInitHandler.tsx +++ b/src/libs/Navigation/AppNavigator/AuthScreensInitHandler.tsx @@ -43,7 +43,7 @@ function initializePusher(currentUserAccountID?: number, getReportAttributes?: ( * Extracted from AuthScreens to isolate useOnyx subscriptions: * - SESSION, NVP_INTRO_SELECTED, NVP_ACTIVE_POLICY_ID, * NVP_ONBOARDING (tour selector), ONYX_UPDATES_LAST_UPDATE_ID_APPLIED_TO_CLIENT (x2), - * RAM_ONLY_IS_LOADING_APP + * IS_LOADING_APP */ function AuthScreensInitHandler() { const currentUrl = getCurrentUrl(); @@ -59,7 +59,7 @@ function AuthScreensInitHandler() { const [activePolicyID] = useOnyx(ONYXKEYS.NVP_ACTIVE_POLICY_ID); const [isSelfTourViewed] = useOnyx(ONYXKEYS.NVP_ONBOARDING, {selector: hasSeenTourSelector}); const [lastUpdateIDAppliedToClient] = useOnyx(ONYXKEYS.ONYX_UPDATES_LAST_UPDATE_ID_APPLIED_TO_CLIENT); - const [isLoadingApp] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); + const [isLoadingApp] = useOnyx(ONYXKEYS.IS_LOADING_APP); const lastUpdateIDAppliedToClientRef = useRef(lastUpdateIDAppliedToClient); const isLoadingAppRef = useRef(isLoadingApp); diff --git a/src/libs/Navigation/guards/index.ts b/src/libs/Navigation/guards/index.ts index 5dccdf56978d..33851c2907cc 100644 --- a/src/libs/Navigation/guards/index.ts +++ b/src/libs/Navigation/guards/index.ts @@ -23,7 +23,7 @@ Onyx.connectWithoutView({ }); Onyx.connectWithoutView({ - key: ONYXKEYS.RAM_ONLY_IS_LOADING_APP, + key: ONYXKEYS.IS_LOADING_APP, callback: (value) => { isLoadingApp = value ?? true; }, diff --git a/src/libs/actions/App.ts b/src/libs/actions/App.ts index 912fef8112bd..47bf7f279553 100644 --- a/src/libs/actions/App.ts +++ b/src/libs/actions/App.ts @@ -120,7 +120,7 @@ Onyx.connectWithoutView({ const KEYS_TO_PRESERVE: OnyxKey[] = [ ONYXKEYS.ACCOUNT, - ONYXKEYS.RAM_ONLY_IS_LOADING_APP, + ONYXKEYS.IS_LOADING_APP, ONYXKEYS.RAM_ONLY_IS_SIDEBAR_LOADED, ONYXKEYS.IS_CHECKING_PUBLIC_ROOM, ONYXKEYS.MODAL, @@ -223,7 +223,7 @@ function setSidebarLoaded() { } function setAppLoading(isLoading: boolean) { - Onyx.set(ONYXKEYS.RAM_ONLY_IS_LOADING_APP, isLoading); + Onyx.set(ONYXKEYS.IS_LOADING_APP, isLoading); } /** @@ -299,7 +299,7 @@ type OnyxDataForOpenOrReconnectKeys = | typeof ONYXKEYS.COLLECTION.REPORT | typeof ONYXKEYS.RAM_ONLY_IS_LOADING_REPORT_DATA | typeof ONYXKEYS.HAS_LOADED_APP - | typeof ONYXKEYS.RAM_ONLY_IS_LOADING_APP + | typeof ONYXKEYS.IS_LOADING_APP | typeof ONYXKEYS.LAST_FULL_RECONNECT_TIME; /** @@ -324,7 +324,7 @@ function getOnyxDataForOpenOrReconnect( const result: OnyxData< | typeof ONYXKEYS.RAM_ONLY_IS_LOADING_REPORT_DATA | typeof ONYXKEYS.HAS_LOADED_APP - | typeof ONYXKEYS.RAM_ONLY_IS_LOADING_APP + | typeof ONYXKEYS.IS_LOADING_APP | typeof ONYXKEYS.COLLECTION.REPORT | typeof ONYXKEYS.LAST_FULL_RECONNECT_TIME > = { @@ -355,13 +355,13 @@ function getOnyxDataForOpenOrReconnect( if (isOpenApp) { result.optimisticData?.push({ onyxMethod: Onyx.METHOD.MERGE, - key: ONYXKEYS.RAM_ONLY_IS_LOADING_APP, + key: ONYXKEYS.IS_LOADING_APP, value: true, }); result.finallyData?.push({ onyxMethod: Onyx.METHOD.MERGE, - key: ONYXKEYS.RAM_ONLY_IS_LOADING_APP, + key: ONYXKEYS.IS_LOADING_APP, value: false, }); } @@ -423,7 +423,7 @@ function openApp(shouldKeepPublicRooms = false, allReportsWithDraftComments?: Re // Exception: When forceRun is true (exiting imported state), always make the API call if (isUsingImportedState && !forceRun) { Onyx.multiSet({ - [ONYXKEYS.RAM_ONLY_IS_LOADING_APP]: false, + [ONYXKEYS.IS_LOADING_APP]: false, [ONYXKEYS.HAS_LOADED_APP]: true, }); return Promise.resolve(); diff --git a/src/libs/actions/OnyxUpdateManager/index.ts b/src/libs/actions/OnyxUpdateManager/index.ts index cc8c299e13af..5561c6e1e175 100644 --- a/src/libs/actions/OnyxUpdateManager/index.ts +++ b/src/libs/actions/OnyxUpdateManager/index.ts @@ -46,7 +46,7 @@ let isLoadingApp = false; // `isLoadingApp` is not dependent on any changes on the UI, // so it is okay to use `connectWithoutView` here. Onyx.connectWithoutView({ - key: ONYXKEYS.RAM_ONLY_IS_LOADING_APP, + key: ONYXKEYS.IS_LOADING_APP, callback: (value) => { isLoadingApp = value ?? false; }, diff --git a/src/libs/actions/QueuedOnyxUpdates.ts b/src/libs/actions/QueuedOnyxUpdates.ts index 9f673b38e566..62ce86816243 100644 --- a/src/libs/actions/QueuedOnyxUpdates.ts +++ b/src/libs/actions/QueuedOnyxUpdates.ts @@ -40,7 +40,7 @@ function flushQueue(): Promise { ONYXKEYS.NVP_PREFERRED_LOCALE, ONYXKEYS.RAM_ONLY_ARE_TRANSLATIONS_LOADING, ONYXKEYS.SESSION, - ONYXKEYS.RAM_ONLY_IS_LOADING_APP, + ONYXKEYS.IS_LOADING_APP, ONYXKEYS.HAS_LOADED_APP, ONYXKEYS.CREDENTIALS, ONYXKEYS.RAM_ONLY_IS_SIDEBAR_LOADED, diff --git a/src/pages/NewReportWorkspaceSelectionPage.tsx b/src/pages/NewReportWorkspaceSelectionPage.tsx index 91c00f750102..5812cb594d1a 100644 --- a/src/pages/NewReportWorkspaceSelectionPage.tsx +++ b/src/pages/NewReportWorkspaceSelectionPage.tsx @@ -77,7 +77,7 @@ function NewReportWorkspaceSelectionPage({route}: NewReportWorkspaceSelectionPag const [allTransactions] = useOnyx(ONYXKEYS.COLLECTION.TRANSACTION); const currentUserPersonalDetails = useCurrentUserPersonalDetails(); - const [isLoadingApp] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); + const [isLoadingApp] = useOnyx(ONYXKEYS.IS_LOADING_APP); const shouldShowLoadingIndicator = isLoadingApp && !isOffline; const [pendingPolicySelection, setPendingPolicySelection] = useState<{policy: WorkspaceListItem; shouldShowEmptyReportConfirmation: boolean} | null>(null); diff --git a/src/pages/ReimbursementAccount/ReimbursementAccountPage.tsx b/src/pages/ReimbursementAccount/ReimbursementAccountPage.tsx index ae23e28ed5c8..5ce6d74e9545 100644 --- a/src/pages/ReimbursementAccount/ReimbursementAccountPage.tsx +++ b/src/pages/ReimbursementAccount/ReimbursementAccountPage.tsx @@ -84,7 +84,7 @@ function ReimbursementAccountPage({route, policy, isLoadingPolicy, navigation}: const [reimbursementAccountDraft] = useOnyx(ONYXKEYS.FORMS.REIMBURSEMENT_ACCOUNT_FORM_DRAFT); const [plaidCurrentEvent = ''] = useOnyx(ONYXKEYS.PLAID_CURRENT_EVENT); const [onfidoToken = ''] = useOnyx(ONYXKEYS.ONFIDO_TOKEN); - const [isLoadingApp = false] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); + const [isLoadingApp = false] = useOnyx(ONYXKEYS.IS_LOADING_APP); const topmostFullScreenRoute = useRootNavigationState((state) => state?.routes.findLast((lastRoute) => isFullScreenName(lastRoute.name))); const {isBetaEnabled} = usePermissions(); diff --git a/src/pages/ReportChangeWorkspacePage.tsx b/src/pages/ReportChangeWorkspacePage.tsx index b6610d3eefae..96fa4c97a99a 100644 --- a/src/pages/ReportChangeWorkspacePage.tsx +++ b/src/pages/ReportChangeWorkspacePage.tsx @@ -58,7 +58,7 @@ function ReportChangeWorkspacePage({report, route}: ReportChangeWorkspacePagePro const [policies, fetchStatus] = useOnyx(ONYXKEYS.COLLECTION.POLICY); const [reportNextStep] = useOnyx(`${ONYXKEYS.COLLECTION.NEXT_STEP}${reportID}`); const [isChangePolicyTrainingModalDismissed = false] = useOnyx(ONYXKEYS.NVP_DISMISSED_PRODUCT_TRAINING, {selector: changePolicyTrainingModalDismissedSelector}); - const [isLoadingApp] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); + const [isLoadingApp] = useOnyx(ONYXKEYS.IS_LOADING_APP); const [transactionViolations] = useOnyx(ONYXKEYS.COLLECTION.TRANSACTION_VIOLATIONS); const isReportLastVisibleArchived = useReportIsArchived(report?.parentReportID); const reportOwnerAccountID = report?.ownerAccountID; diff --git a/src/pages/Search/SearchAdvancedFiltersPage/SearchFiltersWorkspacePage.tsx b/src/pages/Search/SearchAdvancedFiltersPage/SearchFiltersWorkspacePage.tsx index 5b5c99489de6..bdde4bd61b7d 100644 --- a/src/pages/Search/SearchAdvancedFiltersPage/SearchFiltersWorkspacePage.tsx +++ b/src/pages/Search/SearchAdvancedFiltersPage/SearchFiltersWorkspacePage.tsx @@ -35,7 +35,7 @@ function SearchFiltersWorkspacePage() { const [searchAdvancedFiltersForm] = useOnyx(ONYXKEYS.FORMS.SEARCH_ADVANCED_FILTERS_FORM); const [policies, policiesResult] = useOnyx(ONYXKEYS.COLLECTION.POLICY); const [currentUserLogin] = useOnyx(ONYXKEYS.SESSION, {selector: emailSelector}); - const [isLoadingApp] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); + const [isLoadingApp] = useOnyx(ONYXKEYS.IS_LOADING_APP); const [searchTerm, debouncedSearchTerm, setSearchTerm] = useDebouncedState(''); const shouldShowLoadingIndicator = isLoadingApp && !isOffline; const selectionListRef = useRef>(null); diff --git a/src/pages/Search/SearchMoneyRequestReportPage.tsx b/src/pages/Search/SearchMoneyRequestReportPage.tsx index 6eab2fb51d7a..4d854cda03a3 100644 --- a/src/pages/Search/SearchMoneyRequestReportPage.tsx +++ b/src/pages/Search/SearchMoneyRequestReportPage.tsx @@ -138,7 +138,7 @@ function SearchMoneyRequestReportPage({route}: SearchMoneyRequestPageProps) { const [reportMetadata = defaultReportMetadata] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_METADATA}${reportIDFromRoute}`); const [policies = getEmptyObject>>()] = useOnyx(ONYXKEYS.COLLECTION.POLICY); const policy = policies?.[`${ONYXKEYS.COLLECTION.POLICY}${report?.policyID}`]; - const [isLoadingApp] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); + const [isLoadingApp] = useOnyx(ONYXKEYS.IS_LOADING_APP); const isReportArchived = useReportIsArchived(report?.reportID); const {isEditingDisabled, isCurrentReportLoadedFromOnyx} = useIsReportReadyToDisplay(report, reportIDFromRoute, isReportArchived); diff --git a/src/pages/SetDefaultWorkspacePage.tsx b/src/pages/SetDefaultWorkspacePage.tsx index 263deba80010..b1c629c1639f 100644 --- a/src/pages/SetDefaultWorkspacePage.tsx +++ b/src/pages/SetDefaultWorkspacePage.tsx @@ -31,7 +31,7 @@ function SetDefaultWorkspacePage({route}: SetDefaultWorkspacePageProps) { const {translate, localeCompare} = useLocalize(); const [policies, fetchStatus] = useOnyx(ONYXKEYS.COLLECTION.POLICY); - const [isLoadingApp] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); + const [isLoadingApp] = useOnyx(ONYXKEYS.IS_LOADING_APP); const [activePolicyID] = useOnyx(ONYXKEYS.NVP_ACTIVE_POLICY_ID); const shouldShowLoadingIndicator = isLoadingApp && !isOffline; diff --git a/src/pages/home/ForYouSection/index.tsx b/src/pages/home/ForYouSection/index.tsx index b4ce2fea6fba..55703ad04dfe 100644 --- a/src/pages/home/ForYouSection/index.tsx +++ b/src/pages/home/ForYouSection/index.tsx @@ -25,7 +25,7 @@ function ForYouSection() { const {translate} = useLocalize(); const {shouldUseNarrowLayout} = useResponsiveLayout(); const [accountID] = useOnyx(ONYXKEYS.SESSION, {selector: accountIDSelector}); - const [isLoadingApp = true] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); + const [isLoadingApp = true] = useOnyx(ONYXKEYS.IS_LOADING_APP); const [isLoadingReportData = false] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_REPORT_DATA); const [reportCounts = CONST.EMPTY_TODOS_REPORT_COUNTS] = useOnyx(ONYXKEYS.DERIVED.TODOS, {selector: todosReportCountsSelector}); const [singleReportIDs = EMPTY_TODOS_SINGLE_REPORT_IDS] = useOnyx(ONYXKEYS.DERIVED.TODOS, {selector: todosSingleReportIDsSelector}); diff --git a/src/pages/home/HomePage.tsx b/src/pages/home/HomePage.tsx index 50d596a2d65b..450686c48ed7 100644 --- a/src/pages/home/HomePage.tsx +++ b/src/pages/home/HomePage.tsx @@ -31,7 +31,7 @@ function HomePage() { const styles = useThemeStyles(); const {translate} = useLocalize(); useDocumentTitle(translate('common.home')); - const [isLoadingApp = true] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); + const [isLoadingApp = true] = useOnyx(ONYXKEYS.IS_LOADING_APP); const [isLoadingReportData = false] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_REPORT_DATA); const isForYouLoading = !!(isLoadingApp || isLoadingReportData); const receiptDropTargetRef = useRef(null); diff --git a/src/pages/inbox/ReportFetchHandler.tsx b/src/pages/inbox/ReportFetchHandler.tsx index fa316de5a35d..c36b82c082dd 100644 --- a/src/pages/inbox/ReportFetchHandler.tsx +++ b/src/pages/inbox/ReportFetchHandler.tsx @@ -74,7 +74,7 @@ function ReportFetchHandler() { const [introSelected] = useOnyx(ONYXKEYS.NVP_INTRO_SELECTED); const [betas] = useOnyx(ONYXKEYS.BETAS); const [onboarding] = useOnyx(ONYXKEYS.NVP_ONBOARDING); - const [isLoadingApp] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); + const [isLoadingApp] = useOnyx(ONYXKEYS.IS_LOADING_APP); const [isLoadingReportData = true] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_REPORT_DATA); const prevIsLoadingReportData = usePrevious(isLoadingReportData); diff --git a/src/pages/inbox/ReportNotFoundGuard.tsx b/src/pages/inbox/ReportNotFoundGuard.tsx index b8753ab8b0ac..7d599068bd84 100644 --- a/src/pages/inbox/ReportNotFoundGuard.tsx +++ b/src/pages/inbox/ReportNotFoundGuard.tsx @@ -37,7 +37,7 @@ function ReportNotFoundGuard({children}: ReportNotFoundGuardProps) { selector: isLoadingInitialReportActionsSelector, }); const [isLoadingReportData = true] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_REPORT_DATA); - const [isLoadingApp] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); + const [isLoadingApp] = useOnyx(ONYXKEYS.IS_LOADING_APP); const [deleteTransactionNavigateBackUrl] = useOnyx(ONYXKEYS.NVP_DELETE_TRANSACTION_NAVIGATE_BACK_URL); const parentReportAction = useParentReportAction(report); diff --git a/src/pages/inbox/report/ReportActionsView.tsx b/src/pages/inbox/report/ReportActionsView.tsx index c85c87e3f7c3..96764eecc23d 100755 --- a/src/pages/inbox/report/ReportActionsView.tsx +++ b/src/pages/inbox/report/ReportActionsView.tsx @@ -139,7 +139,7 @@ function ReportActionsView({reportID, onLayout}: ReportActionsViewProps) { [getTransactionThreadReportActions], ); const [transactionThreadReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${transactionThreadReportID}`); - const [isLoadingApp] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); + const [isLoadingApp] = useOnyx(ONYXKEYS.IS_LOADING_APP); const [visibleReportActionsData] = useOnyx(ONYXKEYS.DERIVED.VISIBLE_REPORT_ACTIONS); const prevTransactionThreadReport = usePrevious(transactionThreadReport); const prevReportActionID = usePrevious(reportActionID); diff --git a/src/pages/inbox/sidebar/BaseSidebarScreen.tsx b/src/pages/inbox/sidebar/BaseSidebarScreen.tsx index 6bc2dcf307f6..f20aa890543e 100644 --- a/src/pages/inbox/sidebar/BaseSidebarScreen.tsx +++ b/src/pages/inbox/sidebar/BaseSidebarScreen.tsx @@ -23,7 +23,7 @@ import SidebarLinksData from './SidebarLinksData'; // remounts (e.g. navigating between tabs). let hasEverFinishedLoading = false; Onyx.connectWithoutView({ - key: ONYXKEYS.RAM_ONLY_IS_LOADING_APP, + key: ONYXKEYS.IS_LOADING_APP, callback: (value) => { if (value !== false) { return; @@ -38,7 +38,7 @@ function BaseSidebarScreen() { const {shouldUseNarrowLayout} = useResponsiveLayout(); const shouldDisplayLHB = !shouldUseNarrowLayout; - const [isLoadingApp = true] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); + const [isLoadingApp = true] = useOnyx(ONYXKEYS.IS_LOADING_APP); const shouldShowSkeleton = isLoadingApp && !hasEverFinishedLoading; // Must be called unconditionally so openApp() can proceed even when diff --git a/src/pages/inbox/sidebar/FABPopoverContent/menuItems/NewWorkspaceMenuItem.tsx b/src/pages/inbox/sidebar/FABPopoverContent/menuItems/NewWorkspaceMenuItem.tsx index f796a132bf5f..4d660811e6b1 100644 --- a/src/pages/inbox/sidebar/FABPopoverContent/menuItems/NewWorkspaceMenuItem.tsx +++ b/src/pages/inbox/sidebar/FABPopoverContent/menuItems/NewWorkspaceMenuItem.tsx @@ -27,7 +27,7 @@ function NewWorkspaceMenuItem() { const {shouldUseNarrowLayout} = useResponsiveLayout(); const icons = useMemoizedLazyExpensifyIcons(['NewWorkspace']); const {isOffline} = useNetwork(); - const [isLoading = false] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); + const [isLoading = false] = useOnyx(ONYXKEYS.IS_LOADING_APP); const [sessionEmail] = useOnyx(ONYXKEYS.SESSION, {selector: emailSelector}); const [allPolicies] = useMappedPolicies(policyMapper); const {isRestrictedPolicyCreation} = usePreferredPolicy(); diff --git a/src/pages/inbox/sidebar/ProfileAvatarWithIndicator.tsx b/src/pages/inbox/sidebar/ProfileAvatarWithIndicator.tsx index 799dd44218b9..ef3f2e6e0950 100644 --- a/src/pages/inbox/sidebar/ProfileAvatarWithIndicator.tsx +++ b/src/pages/inbox/sidebar/ProfileAvatarWithIndicator.tsx @@ -20,7 +20,7 @@ type ProfileAvatarWithIndicatorProps = { function ProfileAvatarWithIndicator({isSelected = false, containerStyles}: ProfileAvatarWithIndicatorProps) { const styles = useThemeStyles(); const currentUserPersonalDetails = useCurrentUserPersonalDetails(); - const [isLoading = true] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); + const [isLoading = true] = useOnyx(ONYXKEYS.IS_LOADING_APP); return ( ) { const {route} = props; const [report] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${route.params.reportID}`); - const [isLoadingApp = true] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); + const [isLoadingApp = true] = useOnyx(ONYXKEYS.IS_LOADING_APP); const [reportDraft] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_DRAFT}${route.params.reportID}`); const [introSelected] = useOnyx(ONYXKEYS.NVP_INTRO_SELECTED); const [betas] = useOnyx(ONYXKEYS.BETAS); diff --git a/src/pages/media/AttachmentModalScreen/routes/ProfileAvatarModalContent.tsx b/src/pages/media/AttachmentModalScreen/routes/ProfileAvatarModalContent.tsx index 1555c1029877..9a79deeb7c8f 100644 --- a/src/pages/media/AttachmentModalScreen/routes/ProfileAvatarModalContent.tsx +++ b/src/pages/media/AttachmentModalScreen/routes/ProfileAvatarModalContent.tsx @@ -26,7 +26,7 @@ function ProfileAvatarModalContent({navigation, route}: AttachmentModalScreenPro const avatarURL = personalDetail?.avatar ?? ''; const displayName = getDisplayNameOrDefault(personalDetail); - const [isLoadingApp = true] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); + const [isLoadingApp = true] = useOnyx(ONYXKEYS.IS_LOADING_APP); const isLoading = personalDetailsMetadata?.[accountID]?.isLoading ?? (isLoadingApp && !Object.keys(personalDetail ?? {}).length); useEffect(() => { diff --git a/src/pages/media/AttachmentModalScreen/routes/WorkspaceAvatarModalContent.tsx b/src/pages/media/AttachmentModalScreen/routes/WorkspaceAvatarModalContent.tsx index ae798e0c5f8f..f1e2083d3cab 100644 --- a/src/pages/media/AttachmentModalScreen/routes/WorkspaceAvatarModalContent.tsx +++ b/src/pages/media/AttachmentModalScreen/routes/WorkspaceAvatarModalContent.tsx @@ -16,7 +16,7 @@ function WorkspaceAvatarModalContent({navigation, route}: AttachmentModalScreenP const defaultAvatars = useDefaultAvatars(); const policy = usePolicy(policyID); - const [isLoadingApp = false] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); + const [isLoadingApp = false] = useOnyx(ONYXKEYS.IS_LOADING_APP); const avatarURL = policy?.avatarURL ?? getDefaultWorkspaceAvatar(policy?.name ?? fallbackLetter); const source = getFullSizeAvatar({avatarSource: avatarURL, defaultAvatars}); diff --git a/src/pages/media/AttachmentModalScreen/routes/report/ReportAddAttachmentModalContent/index.tsx b/src/pages/media/AttachmentModalScreen/routes/report/ReportAddAttachmentModalContent/index.tsx index 46a64206c4b1..31606deb2f2e 100644 --- a/src/pages/media/AttachmentModalScreen/routes/report/ReportAddAttachmentModalContent/index.tsx +++ b/src/pages/media/AttachmentModalScreen/routes/report/ReportAddAttachmentModalContent/index.tsx @@ -47,7 +47,7 @@ function ReportAddAttachmentModalContent({route, navigation}: AttachmentModalScr const [betas] = useOnyx(ONYXKEYS.BETAS); const isReportArchived = useReportIsArchived(reportID); const canPerformWriteAction = canUserPerformWriteAction(report, isReportArchived); - const [isLoadingApp] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); + const [isLoadingApp] = useOnyx(ONYXKEYS.IS_LOADING_APP); const {isOffline} = useNetwork(); const submitRef = useRef(null); diff --git a/src/pages/media/AttachmentModalScreen/routes/report/ReportAttachmentModalContent.tsx b/src/pages/media/AttachmentModalScreen/routes/report/ReportAttachmentModalContent.tsx index 7c5cb427faf3..75600ef3b2b7 100644 --- a/src/pages/media/AttachmentModalScreen/routes/report/ReportAttachmentModalContent.tsx +++ b/src/pages/media/AttachmentModalScreen/routes/report/ReportAttachmentModalContent.tsx @@ -52,7 +52,7 @@ function ReportAttachmentModalContent({route, navigation}: AttachmentModalScreen useNavigateToReportOnRefresh({source: sourceParam, reportID}); - const [isLoadingApp] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); + const [isLoadingApp] = useOnyx(ONYXKEYS.IS_LOADING_APP); const {isOffline} = useNetwork(); const submitRef = useRef(null); diff --git a/src/pages/media/AttachmentModalScreen/routes/report/ReportAvatarModalContent.tsx b/src/pages/media/AttachmentModalScreen/routes/report/ReportAvatarModalContent.tsx index 783672cea989..e64858cd7901 100644 --- a/src/pages/media/AttachmentModalScreen/routes/report/ReportAvatarModalContent.tsx +++ b/src/pages/media/AttachmentModalScreen/routes/report/ReportAvatarModalContent.tsx @@ -18,7 +18,7 @@ function ReportAvatarModalContent({navigation, route}: AttachmentModalScreenProp const defaultAvatars = useDefaultAvatars(); const [report] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${reportID}`); const [policy] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${policyID}`); - const [isLoadingApp = true] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); + const [isLoadingApp = true] = useOnyx(ONYXKEYS.IS_LOADING_APP); const reportAttributes = useReportAttributes(); const attachment: AttachmentModalBaseContentProps = useMemo(() => { diff --git a/src/pages/settings/Profile/DisplayNamePage.tsx b/src/pages/settings/Profile/DisplayNamePage.tsx index d8ce05d703eb..6e91420ba2a1 100644 --- a/src/pages/settings/Profile/DisplayNamePage.tsx +++ b/src/pages/settings/Profile/DisplayNamePage.tsx @@ -41,7 +41,7 @@ const updateDisplayName = ( function DisplayNamePage({currentUserPersonalDetails}: DisplayNamePageProps) { const styles = useThemeStyles(); const {translate, formatPhoneNumber} = useLocalize(); - const [isLoadingApp = true] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); + const [isLoadingApp = true] = useOnyx(ONYXKEYS.IS_LOADING_APP); const currentUserDetails = currentUserPersonalDetails ?? {}; diff --git a/src/pages/settings/Profile/PersonalDetails/BaseLegalNamePage.tsx b/src/pages/settings/Profile/PersonalDetails/BaseLegalNamePage.tsx index 444db737eaeb..c5ac59d1cd3f 100644 --- a/src/pages/settings/Profile/PersonalDetails/BaseLegalNamePage.tsx +++ b/src/pages/settings/Profile/PersonalDetails/BaseLegalNamePage.tsx @@ -90,7 +90,7 @@ function BaseLegalNamePage({ defaultLastName, }: BaseLegalNamePageProps) { const [privatePersonalDetails] = useOnyx(ONYXKEYS.PRIVATE_PERSONAL_DETAILS); - const [isLoadingApp = true] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); + const [isLoadingApp = true] = useOnyx(ONYXKEYS.IS_LOADING_APP); const styles = useThemeStyles(); const {translate} = useLocalize(); diff --git a/src/pages/settings/Profile/PersonalDetails/DateOfBirthPage.tsx b/src/pages/settings/Profile/PersonalDetails/DateOfBirthPage.tsx index bd8ce9a8d463..12c35854a51b 100644 --- a/src/pages/settings/Profile/PersonalDetails/DateOfBirthPage.tsx +++ b/src/pages/settings/Profile/PersonalDetails/DateOfBirthPage.tsx @@ -21,7 +21,7 @@ import INPUT_IDS from '@src/types/form/DateOfBirthForm'; function DateOfBirthPage() { const [privatePersonalDetails] = useOnyx(ONYXKEYS.PRIVATE_PERSONAL_DETAILS); - const [isLoadingApp = true] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); + const [isLoadingApp = true] = useOnyx(ONYXKEYS.IS_LOADING_APP); const {translate} = useLocalize(); const styles = useThemeStyles(); diff --git a/src/pages/settings/Profile/PersonalDetails/PersonalAddressPage.tsx b/src/pages/settings/Profile/PersonalDetails/PersonalAddressPage.tsx index e677cc4587b9..7f553e3c3d5b 100644 --- a/src/pages/settings/Profile/PersonalDetails/PersonalAddressPage.tsx +++ b/src/pages/settings/Profile/PersonalDetails/PersonalAddressPage.tsx @@ -32,7 +32,7 @@ function updateAddress(values: FormOnyxValues normalizeCountryCode(getCurrentAddress(privatePersonalDetails)) as Address, [privatePersonalDetails]); diff --git a/src/pages/settings/Profile/PersonalDetails/PhoneNumberPage.tsx b/src/pages/settings/Profile/PersonalDetails/PhoneNumberPage.tsx index 8fd4033dfc66..46b6f49a7415 100644 --- a/src/pages/settings/Profile/PersonalDetails/PhoneNumberPage.tsx +++ b/src/pages/settings/Profile/PersonalDetails/PhoneNumberPage.tsx @@ -26,7 +26,7 @@ import type {PrivatePersonalDetails} from '@src/types/onyx'; function PhoneNumberPage() { const [privatePersonalDetails] = useOnyx(ONYXKEYS.PRIVATE_PERSONAL_DETAILS); - const [isLoadingApp = true] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); + const [isLoadingApp = true] = useOnyx(ONYXKEYS.IS_LOADING_APP); const [countryCode = CONST.DEFAULT_COUNTRY_CODE] = useOnyx(ONYXKEYS.COUNTRY_CODE); const styles = useThemeStyles(); const {translate} = useLocalize(); diff --git a/src/pages/settings/Profile/ProfilePage.tsx b/src/pages/settings/Profile/ProfilePage.tsx index f2ec7300f197..502bc6f6fecf 100755 --- a/src/pages/settings/Profile/ProfilePage.tsx +++ b/src/pages/settings/Profile/ProfilePage.tsx @@ -52,7 +52,7 @@ function ProfilePage() { const currentUserPersonalDetails = useCurrentUserPersonalDetails(); const route = useRoute>(); useDocumentTitle(translate('common.profile')); - const [isLoadingApp] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); + const [isLoadingApp] = useOnyx(ONYXKEYS.IS_LOADING_APP); const getPronouns = (): string => { const pronounsKey = currentUserPersonalDetails?.pronouns?.replace(CONST.PRONOUNS.PREFIX, '') ?? ''; return pronounsKey ? translate(`pronouns.${pronounsKey}` as TranslationPaths) : translate('profilePage.selectYourPronouns'); diff --git a/src/pages/settings/Profile/PronounsPage.tsx b/src/pages/settings/Profile/PronounsPage.tsx index db79dd611a7b..17201155ca70 100644 --- a/src/pages/settings/Profile/PronounsPage.tsx +++ b/src/pages/settings/Profile/PronounsPage.tsx @@ -26,7 +26,7 @@ type PronounsPageProps = WithCurrentUserPersonalDetailsProps; function PronounsPage({currentUserPersonalDetails}: PronounsPageProps) { const styles = useThemeStyles(); const {translate, localeCompare} = useLocalize(); - const [isLoadingApp = true] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); + const [isLoadingApp = true] = useOnyx(ONYXKEYS.IS_LOADING_APP); const currentPronouns = currentUserPersonalDetails?.pronouns ?? ''; const currentPronounsKey = currentPronouns.substring(CONST.PRONOUNS.PREFIX.length); const [searchValue, setSearchValue] = useState(''); diff --git a/src/pages/settings/Subscription/SubscriptionSettingsPage.tsx b/src/pages/settings/Subscription/SubscriptionSettingsPage.tsx index 3896324336ef..5693bbc6871b 100644 --- a/src/pages/settings/Subscription/SubscriptionSettingsPage.tsx +++ b/src/pages/settings/Subscription/SubscriptionSettingsPage.tsx @@ -34,7 +34,7 @@ function SubscriptionSettingsPage({route}: SubscriptionSettingsPageProps) { useEffect(() => { openSubscriptionPage(); }, []); - const [isAppLoading = true] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); + const [isAppLoading = true] = useOnyx(ONYXKEYS.IS_LOADING_APP); const [amountOwed] = useOnyx(ONYXKEYS.NVP_PRIVATE_AMOUNT_OWED); const shouldShowPage = !!subscriptionPlan || (amountOwed ?? 0) > 0; diff --git a/src/pages/settings/Wallet/WalletPage/index.tsx b/src/pages/settings/Wallet/WalletPage/index.tsx index de4b8a179bd0..7bc6c3ca54ba 100644 --- a/src/pages/settings/Wallet/WalletPage/index.tsx +++ b/src/pages/settings/Wallet/WalletPage/index.tsx @@ -77,7 +77,7 @@ function WalletPage() { const [userWallet] = useOnyx(ONYXKEYS.USER_WALLET); const [countryByIp] = useOnyx(ONYXKEYS.COUNTRY); const [walletTerms = getEmptyObject()] = useOnyx(ONYXKEYS.WALLET_TERMS); - const [isLoadingApp] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); + const [isLoadingApp] = useOnyx(ONYXKEYS.IS_LOADING_APP); const [userAccount] = useOnyx(ONYXKEYS.ACCOUNT); const [lastUsedPaymentMethods] = useOnyx(ONYXKEYS.NVP_LAST_PAYMENT_METHOD); const [personalPolicyID] = useOnyx(ONYXKEYS.PERSONAL_POLICY_ID); diff --git a/src/pages/workspace/WorkspacesListPage.tsx b/src/pages/workspace/WorkspacesListPage.tsx index 1017d1090749..bad00af642fd 100755 --- a/src/pages/workspace/WorkspacesListPage.tsx +++ b/src/pages/workspace/WorkspacesListPage.tsx @@ -146,7 +146,7 @@ function WorkspacesListPage() { const [reimbursementAccount] = useOnyx(ONYXKEYS.REIMBURSEMENT_ACCOUNT); const [session] = useOnyx(ONYXKEYS.SESSION); const [activePolicyID] = useOnyx(ONYXKEYS.NVP_ACTIVE_POLICY_ID); - const [isLoadingApp] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); + const [isLoadingApp] = useOnyx(ONYXKEYS.IS_LOADING_APP); const [lastPaymentMethod] = useOnyx(ONYXKEYS.NVP_LAST_PAYMENT_METHOD); const shouldShowLoadingIndicator = isLoadingApp && !isOffline; const route = useRoute>(); diff --git a/src/setup/index.ts b/src/setup/index.ts index 3ca084804264..c589c291eb8b 100644 --- a/src/setup/index.ts +++ b/src/setup/index.ts @@ -65,7 +65,6 @@ export default function () { ONYXKEYS.RAM_ONLY_MOBILE_SELECTION_MODE, ONYXKEYS.RAM_ONLY_IS_SIDEBAR_LOADED, ONYXKEYS.RAM_ONLY_IS_LOADING_REPORT_DATA, - ONYXKEYS.RAM_ONLY_IS_LOADING_APP, ONYXKEYS.COLLECTION.RAM_ONLY_ISSUE_NEW_EXPENSIFY_CARD, ONYXKEYS.DERIVED.RAM_ONLY_SORTED_REPORT_ACTIONS, ONYXKEYS.RAM_ONLY_UPDATE_AVAILABLE, diff --git a/tests/actions/QueuedOnyxUpdatesTest.ts b/tests/actions/QueuedOnyxUpdatesTest.ts index b4b3614f9469..5a7190f42945 100644 --- a/tests/actions/QueuedOnyxUpdatesTest.ts +++ b/tests/actions/QueuedOnyxUpdatesTest.ts @@ -11,7 +11,7 @@ const queuedOnyxUpdates: Array< | typeof ONYXKEYS.PREFERRED_THEME | typeof ONYXKEYS.NVP_PREFERRED_LOCALE | typeof ONYXKEYS.SESSION - | typeof ONYXKEYS.RAM_ONLY_IS_LOADING_APP + | typeof ONYXKEYS.IS_LOADING_APP | typeof ONYXKEYS.CREDENTIALS | typeof ONYXKEYS.RAM_ONLY_IS_SIDEBAR_LOADED | typeof ONYXKEYS.COLLECTION.REPORT @@ -32,7 +32,7 @@ const queuedOnyxUpdates: Array< }, onyxMethod: 'merge', }, - {key: ONYXKEYS.RAM_ONLY_IS_LOADING_APP, value: false, onyxMethod: 'merge'}, + {key: ONYXKEYS.IS_LOADING_APP, value: false, onyxMethod: 'merge'}, { key: ONYXKEYS.CREDENTIALS, value: { @@ -104,7 +104,7 @@ describe('actions/QueuedOnyxUpdates', () => { await testOnyxKeyValue(ONYXKEYS.PREFERRED_THEME); await testOnyxKeyValue(ONYXKEYS.NVP_PREFERRED_LOCALE); await testOnyxKeyValue(ONYXKEYS.SESSION); - await testOnyxKeyValue(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); + await testOnyxKeyValue(ONYXKEYS.IS_LOADING_APP); await testOnyxKeyValue(ONYXKEYS.CREDENTIALS); await testOnyxKeyValue(ONYXKEYS.RAM_ONLY_IS_SIDEBAR_LOADED); @@ -149,7 +149,7 @@ describe('actions/QueuedOnyxUpdates', () => { await testOnyxKeyValue(ONYXKEYS.PREFERRED_THEME); await testOnyxKeyValue(ONYXKEYS.NVP_PREFERRED_LOCALE); await testOnyxKeyValue(ONYXKEYS.SESSION); - await testOnyxKeyValue(ONYXKEYS.RAM_ONLY_IS_LOADING_APP); + await testOnyxKeyValue(ONYXKEYS.IS_LOADING_APP); await testOnyxKeyValue(ONYXKEYS.CREDENTIALS); await testOnyxKeyValue(ONYXKEYS.RAM_ONLY_IS_SIDEBAR_LOADED); diff --git a/tests/ui/AddressPageTest.tsx b/tests/ui/AddressPageTest.tsx index c0287eb9217b..93e65889bef9 100644 --- a/tests/ui/AddressPageTest.tsx +++ b/tests/ui/AddressPageTest.tsx @@ -66,7 +66,7 @@ describe('AddressPageTest', () => { }, ], }); - await Onyx.merge(`${ONYXKEYS.RAM_ONLY_IS_LOADING_APP}`, false); + await Onyx.merge(`${ONYXKEYS.IS_LOADING_APP}`, false); }); await waitForBatchedUpdatesWithAct(); @@ -96,7 +96,7 @@ describe('AddressPageTest', () => { }, ], }); - await Onyx.merge(`${ONYXKEYS.RAM_ONLY_IS_LOADING_APP}`, false); + await Onyx.merge(`${ONYXKEYS.IS_LOADING_APP}`, false); }); await waitForBatchedUpdatesWithAct(); @@ -118,7 +118,7 @@ describe('AddressPageTest', () => { }, ], }); - await Onyx.merge(`${ONYXKEYS.RAM_ONLY_IS_LOADING_APP}`, false); + await Onyx.merge(`${ONYXKEYS.IS_LOADING_APP}`, false); }); await waitForBatchedUpdatesWithAct(); diff --git a/tests/ui/AuthScreensInitHandlerTest.tsx b/tests/ui/AuthScreensInitHandlerTest.tsx index fe9b56b37387..9d9197186927 100644 --- a/tests/ui/AuthScreensInitHandlerTest.tsx +++ b/tests/ui/AuthScreensInitHandlerTest.tsx @@ -221,7 +221,7 @@ describe('AuthScreensInitHandler', () => { it('calls handleNetworkReconnect with openApp when isLoadingApp is true', async () => { await Onyx.merge(ONYXKEYS.SESSION, {accountID: TEST_ACCOUNT_ID, email: 'test@test.com'}); - await Onyx.merge(ONYXKEYS.RAM_ONLY_IS_LOADING_APP, true); + await Onyx.merge(ONYXKEYS.IS_LOADING_APP, true); await waitForBatchedUpdates(); renderAuthScreensInitHandler(); @@ -238,7 +238,7 @@ describe('AuthScreensInitHandler', () => { it('calls handleNetworkReconnect with reconnectApp when isLoadingApp is false', async () => { await Onyx.merge(ONYXKEYS.SESSION, {accountID: TEST_ACCOUNT_ID, email: 'test@test.com'}); - await Onyx.merge(ONYXKEYS.RAM_ONLY_IS_LOADING_APP, false); + await Onyx.merge(ONYXKEYS.IS_LOADING_APP, false); await waitForBatchedUpdates(); renderAuthScreensInitHandler(); diff --git a/tests/ui/ForYouSectionTest.tsx b/tests/ui/ForYouSectionTest.tsx index 18b53dd9651d..231acf542c84 100644 --- a/tests/ui/ForYouSectionTest.tsx +++ b/tests/ui/ForYouSectionTest.tsx @@ -105,7 +105,7 @@ describe('ForYouSection', () => { await act(async () => { await Onyx.multiSet({ [ONYXKEYS.SESSION]: {accountID: ACCOUNT_ID, email: 'test@example.com'}, - [ONYXKEYS.RAM_ONLY_IS_LOADING_APP]: false, + [ONYXKEYS.IS_LOADING_APP]: false, }); }); await waitForBatchedUpdatesWithAct(); diff --git a/tests/ui/GroupChatNameTests.tsx b/tests/ui/GroupChatNameTests.tsx index 220666d79be2..7bd69524916e 100644 --- a/tests/ui/GroupChatNameTests.tsx +++ b/tests/ui/GroupChatNameTests.tsx @@ -198,7 +198,7 @@ function signInAndGetApp(reportName = '', participantAccountIDs?: number[]): Pro // Simulate setting an unread report and personal details await act(async () => { await Promise.all([ - Onyx.merge(ONYXKEYS.RAM_ONLY_IS_LOADING_APP, false), + Onyx.merge(ONYXKEYS.IS_LOADING_APP, false), Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT}${REPORT_ID}`, { reportID: REPORT_ID, reportName, diff --git a/tests/ui/LHNItemsPresence.tsx b/tests/ui/LHNItemsPresence.tsx index 0f609fb43b89..eb92ed5aa7f9 100644 --- a/tests/ui/LHNItemsPresence.tsx +++ b/tests/ui/LHNItemsPresence.tsx @@ -140,7 +140,7 @@ describe('SidebarLinksData', () => { [ONYXKEYS.NVP_PRIORITY_MODE]: CONST.PRIORITY_MODE.GSD, [ONYXKEYS.BETAS]: betas, [ONYXKEYS.PERSONAL_DETAILS_LIST]: LHNTestUtils.fakePersonalDetails, - [ONYXKEYS.RAM_ONLY_IS_LOADING_APP]: false, + [ONYXKEYS.IS_LOADING_APP]: false, ...(reportData ?? {}), ...(otherData ?? {}), }); diff --git a/tests/ui/PaginationTest.tsx b/tests/ui/PaginationTest.tsx index 54686d06a26e..630a4c94b355 100644 --- a/tests/ui/PaginationTest.tsx +++ b/tests/ui/PaginationTest.tsx @@ -232,7 +232,7 @@ async function signInAndGetApp(): Promise { await act(async () => { await Promise.all([ - Onyx.merge(ONYXKEYS.RAM_ONLY_IS_LOADING_APP, false), + Onyx.merge(ONYXKEYS.IS_LOADING_APP, false), // Simulate setting an unread report and personal details Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT}${REPORT_ID}`, { reportID: REPORT_ID, diff --git a/tests/ui/ProfilePageTest.tsx b/tests/ui/ProfilePageTest.tsx index bd270b06dcde..599677fecff4 100644 --- a/tests/ui/ProfilePageTest.tsx +++ b/tests/ui/ProfilePageTest.tsx @@ -200,7 +200,7 @@ describe('ProfilePage - SMS domain handling', () => { await act(async () => { await Onyx.merge(ONYXKEYS.PERSONAL_DETAILS_LIST, personalDetails); - await Onyx.merge(ONYXKEYS.RAM_ONLY_IS_LOADING_APP, false); + await Onyx.merge(ONYXKEYS.IS_LOADING_APP, false); }); await waitForBatchedUpdatesWithAct(); @@ -240,7 +240,7 @@ describe('ProfilePage - SMS domain handling', () => { await act(async () => { await Onyx.merge(ONYXKEYS.PERSONAL_DETAILS_LIST, personalDetails); - await Onyx.merge(ONYXKEYS.RAM_ONLY_IS_LOADING_APP, false); + await Onyx.merge(ONYXKEYS.IS_LOADING_APP, false); }); await waitForBatchedUpdatesWithAct(); diff --git a/tests/ui/ReportActionsViewTest.tsx b/tests/ui/ReportActionsViewTest.tsx index 9bc7440e0a26..8983c0705aaa 100644 --- a/tests/ui/ReportActionsViewTest.tsx +++ b/tests/ui/ReportActionsViewTest.tsx @@ -196,7 +196,7 @@ describe('ReportActionsView', () => { mockUseReportTransactionsCollection.mockReturnValue({}); mockUseOnyx.mockImplementation((key: string) => { - if (key === ONYXKEYS.RAM_ONLY_IS_LOADING_APP) { + if (key === ONYXKEYS.IS_LOADING_APP) { return [false, {status: 'loaded'}]; } if (key === ONYXKEYS.RAM_ONLY_ARE_TRANSLATIONS_LOADING) { @@ -230,7 +230,7 @@ describe('ReportActionsView', () => { }); mockUseOnyx.mockImplementation((key: string) => { - if (key === ONYXKEYS.RAM_ONLY_IS_LOADING_APP) { + if (key === ONYXKEYS.IS_LOADING_APP) { return [true, {status: 'loaded'}]; } if (key === ONYXKEYS.RAM_ONLY_ARE_TRANSLATIONS_LOADING) { @@ -267,7 +267,7 @@ describe('ReportActionsView', () => { }); mockUseOnyx.mockImplementation((key: string) => { - if (key === ONYXKEYS.RAM_ONLY_IS_LOADING_APP) { + if (key === ONYXKEYS.IS_LOADING_APP) { return [false, {status: 'loaded'}]; } if (key === ONYXKEYS.RAM_ONLY_ARE_TRANSLATIONS_LOADING) { @@ -299,7 +299,7 @@ describe('ReportActionsView', () => { }); mockUseOnyx.mockImplementation((key: string) => { - if (key === ONYXKEYS.RAM_ONLY_IS_LOADING_APP) { + if (key === ONYXKEYS.IS_LOADING_APP) { return [true, {status: 'loaded'}]; } if (key === ONYXKEYS.RAM_ONLY_ARE_TRANSLATIONS_LOADING) { @@ -331,7 +331,7 @@ describe('ReportActionsView', () => { }); mockUseOnyx.mockImplementation((key: string) => { - if (key === ONYXKEYS.RAM_ONLY_IS_LOADING_APP) { + if (key === ONYXKEYS.IS_LOADING_APP) { return [false, {status: 'loaded'}]; } if (key === ONYXKEYS.RAM_ONLY_ARE_TRANSLATIONS_LOADING) { @@ -397,7 +397,7 @@ describe('ReportActionsView', () => { if (key === ONYXKEYS.CONCIERGE_REPORT_ID) { return [CONCIERGE_REPORT_ID, {status: 'loaded'}]; } - if (key === ONYXKEYS.RAM_ONLY_IS_LOADING_APP) { + if (key === ONYXKEYS.IS_LOADING_APP) { return [false, {status: 'loaded'}]; } if (key === ONYXKEYS.RAM_ONLY_ARE_TRANSLATIONS_LOADING) { diff --git a/tests/ui/ReportAttachments.tsx b/tests/ui/ReportAttachments.tsx index a8101deeff9e..7aae70f2e69c 100644 --- a/tests/ui/ReportAttachments.tsx +++ b/tests/ui/ReportAttachments.tsx @@ -149,7 +149,7 @@ describe('ReportAttachments', () => { global.fetch = getGlobalFetchMock(); wrapOnyxWithWaitForBatchedUpdates(Onyx); await act(async () => { - await Onyx.merge(ONYXKEYS.RAM_ONLY_IS_LOADING_APP, false); + await Onyx.merge(ONYXKEYS.IS_LOADING_APP, false); }); await waitForBatchedUpdatesWithAct(); diff --git a/tests/ui/SessionTest.tsx b/tests/ui/SessionTest.tsx index 476755d398e6..7c2ea776385b 100644 --- a/tests/ui/SessionTest.tsx +++ b/tests/ui/SessionTest.tsx @@ -94,7 +94,7 @@ describe('Deep linking', () => { jest.spyOn(AppActions, 'openApp').mockImplementation(async () => { const originalResult = await originalOpenApp(); await Onyx.set(`${ONYXKEYS.COLLECTION.REPORT}${report.reportID}`, report); - await Onyx.merge(ONYXKEYS.RAM_ONLY_IS_LOADING_APP, false); + await Onyx.merge(ONYXKEYS.IS_LOADING_APP, false); return originalResult; }); }); diff --git a/tests/ui/UnreadIndicatorsTest.tsx b/tests/ui/UnreadIndicatorsTest.tsx index 2229d33840c6..d1af4839f23b 100644 --- a/tests/ui/UnreadIndicatorsTest.tsx +++ b/tests/ui/UnreadIndicatorsTest.tsx @@ -214,7 +214,7 @@ async function signInAndGetAppWithUnreadChat(): Promise { }; await Promise.all([ - Onyx.merge(ONYXKEYS.RAM_ONLY_IS_LOADING_APP, false), + Onyx.merge(ONYXKEYS.IS_LOADING_APP, false), Onyx.merge(ONYXKEYS.PERSONAL_DETAILS_LIST, personalDetails), Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT}${REPORT_ID}`, report), Onyx.merge(`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${REPORT_ID}`, reportActions), diff --git a/tests/ui/components/ProductTrainingContextProvider.tsx b/tests/ui/components/ProductTrainingContextProvider.tsx index a8b36c90248d..81791f0dc121 100644 --- a/tests/ui/components/ProductTrainingContextProvider.tsx +++ b/tests/ui/components/ProductTrainingContextProvider.tsx @@ -66,7 +66,7 @@ describe('ProductTrainingContextProvider', () => { // Set up test environment before each test wrapOnyxWithWaitForBatchedUpdates(Onyx); Onyx.merge(ONYXKEYS.NETWORK, {isOffline: false}); - Onyx.merge(ONYXKEYS.RAM_ONLY_IS_LOADING_APP, false); + Onyx.merge(ONYXKEYS.IS_LOADING_APP, false); signUpWithTestUser(); }); @@ -82,7 +82,7 @@ describe('ProductTrainingContextProvider', () => { describe('Basic Tooltip Registration', () => { it('should not register tooltips when app is loading', async () => { // When app is loading - Onyx.merge(ONYXKEYS.RAM_ONLY_IS_LOADING_APP, true); + Onyx.merge(ONYXKEYS.IS_LOADING_APP, true); await waitForBatchedUpdatesWithAct(); const testTooltip = CONST.PRODUCT_TRAINING_TOOLTIP_NAMES.SCAN_TEST_TOOLTIP; diff --git a/tests/unit/SidebarOrderTest.ts b/tests/unit/SidebarOrderTest.ts index 3d2af7271693..6ab60e5f9946 100644 --- a/tests/unit/SidebarOrderTest.ts +++ b/tests/unit/SidebarOrderTest.ts @@ -95,7 +95,7 @@ describe('Sidebar', () => { .then(() => Onyx.multiSet({ [ONYXKEYS.PERSONAL_DETAILS_LIST]: LHNTestUtils.fakePersonalDetails, - [ONYXKEYS.RAM_ONLY_IS_LOADING_APP]: false, + [ONYXKEYS.IS_LOADING_APP]: false, }), ) @@ -122,7 +122,7 @@ describe('Sidebar', () => { Onyx.multiSet({ [ONYXKEYS.NVP_PRIORITY_MODE]: CONST.PRIORITY_MODE.DEFAULT, [ONYXKEYS.PERSONAL_DETAILS_LIST]: LHNTestUtils.fakePersonalDetails, - [ONYXKEYS.RAM_ONLY_IS_LOADING_APP]: false, + [ONYXKEYS.IS_LOADING_APP]: false, ...reportCollectionDataSet, }), ) @@ -160,7 +160,7 @@ describe('Sidebar', () => { Onyx.multiSet({ [ONYXKEYS.NVP_PRIORITY_MODE]: CONST.PRIORITY_MODE.DEFAULT, [ONYXKEYS.PERSONAL_DETAILS_LIST]: LHNTestUtils.fakePersonalDetails, - [ONYXKEYS.RAM_ONLY_IS_LOADING_APP]: false, + [ONYXKEYS.IS_LOADING_APP]: false, ...reportCollectionDataSet, }), ) @@ -209,7 +209,7 @@ describe('Sidebar', () => { Onyx.multiSet({ [ONYXKEYS.NVP_PRIORITY_MODE]: CONST.PRIORITY_MODE.DEFAULT, [ONYXKEYS.PERSONAL_DETAILS_LIST]: LHNTestUtils.fakePersonalDetails, - [ONYXKEYS.RAM_ONLY_IS_LOADING_APP]: false, + [ONYXKEYS.IS_LOADING_APP]: false, [`${ONYXKEYS.COLLECTION.REPORT_DRAFT_COMMENT}${report1.reportID}`]: 'report1 draft', ...reportCollectionDataSet, }), @@ -256,7 +256,7 @@ describe('Sidebar', () => { Onyx.multiSet({ [ONYXKEYS.NVP_PRIORITY_MODE]: CONST.PRIORITY_MODE.DEFAULT, [ONYXKEYS.PERSONAL_DETAILS_LIST]: LHNTestUtils.fakePersonalDetails, - [ONYXKEYS.RAM_ONLY_IS_LOADING_APP]: false, + [ONYXKEYS.IS_LOADING_APP]: false, ...reportCollectionDataSet, }), ) @@ -319,7 +319,7 @@ describe('Sidebar', () => { Onyx.multiSet({ [ONYXKEYS.NVP_PRIORITY_MODE]: CONST.PRIORITY_MODE.DEFAULT, [ONYXKEYS.PERSONAL_DETAILS_LIST]: LHNTestUtils.fakePersonalDetails, - [ONYXKEYS.RAM_ONLY_IS_LOADING_APP]: false, + [ONYXKEYS.IS_LOADING_APP]: false, ...reportCollectionDataSet, }), ) @@ -393,7 +393,7 @@ describe('Sidebar', () => { Onyx.multiSet({ [ONYXKEYS.NVP_PRIORITY_MODE]: CONST.PRIORITY_MODE.DEFAULT, [ONYXKEYS.PERSONAL_DETAILS_LIST]: LHNTestUtils.fakePersonalDetails, - [ONYXKEYS.RAM_ONLY_IS_LOADING_APP]: false, + [ONYXKEYS.IS_LOADING_APP]: false, ...reportCollectionDataSet, }), ) @@ -472,7 +472,7 @@ describe('Sidebar', () => { Onyx.multiSet({ [ONYXKEYS.NVP_PRIORITY_MODE]: CONST.PRIORITY_MODE.DEFAULT, [ONYXKEYS.PERSONAL_DETAILS_LIST]: LHNTestUtils.fakePersonalDetails, - [ONYXKEYS.RAM_ONLY_IS_LOADING_APP]: false, + [ONYXKEYS.IS_LOADING_APP]: false, [`${ONYXKEYS.COLLECTION.POLICY}${fakeReport.policyID}`]: fakePolicy, ...reportCollectionDataSet, }), @@ -523,7 +523,7 @@ describe('Sidebar', () => { Onyx.multiSet({ [ONYXKEYS.NVP_PRIORITY_MODE]: CONST.PRIORITY_MODE.DEFAULT, [ONYXKEYS.PERSONAL_DETAILS_LIST]: LHNTestUtils.fakePersonalDetails, - [ONYXKEYS.RAM_ONLY_IS_LOADING_APP]: false, + [ONYXKEYS.IS_LOADING_APP]: false, [ONYXKEYS.COLLECTION.REPORT_DRAFT_COMMENT + report2.reportID]: 'This is a draft', ...reportCollectionDataSet, }), @@ -570,7 +570,7 @@ describe('Sidebar', () => { Onyx.multiSet({ [ONYXKEYS.NVP_PRIORITY_MODE]: CONST.PRIORITY_MODE.DEFAULT, [ONYXKEYS.PERSONAL_DETAILS_LIST]: LHNTestUtils.fakePersonalDetails, - [ONYXKEYS.RAM_ONLY_IS_LOADING_APP]: false, + [ONYXKEYS.IS_LOADING_APP]: false, [`${ONYXKEYS.COLLECTION.REPORT_DRAFT_COMMENT}${report.reportID}`]: 'This is a draft', ...reportCollectionDataSet, }), @@ -612,7 +612,7 @@ describe('Sidebar', () => { Onyx.multiSet({ [ONYXKEYS.NVP_PRIORITY_MODE]: CONST.PRIORITY_MODE.DEFAULT, [ONYXKEYS.PERSONAL_DETAILS_LIST]: LHNTestUtils.fakePersonalDetails, - [ONYXKEYS.RAM_ONLY_IS_LOADING_APP]: false, + [ONYXKEYS.IS_LOADING_APP]: false, ...reportCollectionDataSet, }), ) @@ -696,7 +696,7 @@ describe('Sidebar', () => { Onyx.multiSet({ [ONYXKEYS.NVP_PRIORITY_MODE]: CONST.PRIORITY_MODE.DEFAULT, [ONYXKEYS.PERSONAL_DETAILS_LIST]: LHNTestUtils.fakePersonalDetails, - [ONYXKEYS.RAM_ONLY_IS_LOADING_APP]: false, + [ONYXKEYS.IS_LOADING_APP]: false, [`${ONYXKEYS.COLLECTION.REPORT_DRAFT_COMMENT}${report2.reportID}`]: 'Report2 draft comment', ...reportCollectionDataSet, }), @@ -754,7 +754,7 @@ describe('Sidebar', () => { Onyx.multiSet({ [ONYXKEYS.NVP_PRIORITY_MODE]: CONST.PRIORITY_MODE.DEFAULT, [ONYXKEYS.PERSONAL_DETAILS_LIST]: LHNTestUtils.fakePersonalDetails, - [ONYXKEYS.RAM_ONLY_IS_LOADING_APP]: false, + [ONYXKEYS.IS_LOADING_APP]: false, ...reportCollectionDataSet, }), ) @@ -816,7 +816,7 @@ describe('Sidebar', () => { Onyx.multiSet({ [ONYXKEYS.NVP_PRIORITY_MODE]: CONST.PRIORITY_MODE.DEFAULT, [ONYXKEYS.PERSONAL_DETAILS_LIST]: LHNTestUtils.fakePersonalDetails, - [ONYXKEYS.RAM_ONLY_IS_LOADING_APP]: false, + [ONYXKEYS.IS_LOADING_APP]: false, ...reportDraftCommentCollectionDataSet, ...reportCollectionDataSet, }), @@ -888,7 +888,7 @@ describe('Sidebar', () => { [ONYXKEYS.BETAS]: betas, [ONYXKEYS.NVP_PRIORITY_MODE]: CONST.PRIORITY_MODE.DEFAULT, [ONYXKEYS.PERSONAL_DETAILS_LIST]: LHNTestUtils.fakePersonalDetails, - [ONYXKEYS.RAM_ONLY_IS_LOADING_APP]: false, + [ONYXKEYS.IS_LOADING_APP]: false, ...reportNameValuePairsCollectionDataSet, ...reportCollectionDataSet, }), @@ -932,7 +932,7 @@ describe('Sidebar', () => { Onyx.multiSet({ [ONYXKEYS.NVP_PRIORITY_MODE]: CONST.PRIORITY_MODE.DEFAULT, [ONYXKEYS.PERSONAL_DETAILS_LIST]: LHNTestUtils.fakePersonalDetails, - [ONYXKEYS.RAM_ONLY_IS_LOADING_APP]: false, + [ONYXKEYS.IS_LOADING_APP]: false, ...reportCollectionDataSet, }), ) @@ -972,7 +972,7 @@ describe('Sidebar', () => { .then(() => Onyx.multiSet({ [ONYXKEYS.NVP_PRIORITY_MODE]: CONST.PRIORITY_MODE.GSD, - [ONYXKEYS.RAM_ONLY_IS_LOADING_APP]: false, + [ONYXKEYS.IS_LOADING_APP]: false, ...reportCollectionDataSet, }), ) @@ -1035,7 +1035,7 @@ describe('Sidebar', () => { [ONYXKEYS.BETAS]: betas, [ONYXKEYS.NVP_PRIORITY_MODE]: CONST.PRIORITY_MODE.GSD, [ONYXKEYS.PERSONAL_DETAILS_LIST]: LHNTestUtils.fakePersonalDetails, - [ONYXKEYS.RAM_ONLY_IS_LOADING_APP]: false, + [ONYXKEYS.IS_LOADING_APP]: false, ...reportNameValuePairsCollectionDataSet, ...reportCollectionDataSet, }), diff --git a/tests/unit/SidebarTest.ts b/tests/unit/SidebarTest.ts index 81940ec35630..2c8d3c6e8206 100644 --- a/tests/unit/SidebarTest.ts +++ b/tests/unit/SidebarTest.ts @@ -95,7 +95,7 @@ describe('Sidebar', () => { [ONYXKEYS.BETAS]: betas, [ONYXKEYS.NVP_PRIORITY_MODE]: CONST.PRIORITY_MODE.GSD, [ONYXKEYS.PERSONAL_DETAILS_LIST]: LHNTestUtils.fakePersonalDetails, - [ONYXKEYS.RAM_ONLY_IS_LOADING_APP]: false, + [ONYXKEYS.IS_LOADING_APP]: false, ...reportNameValuePairsCollection, ...reportCollection, ...reportAction, @@ -158,7 +158,7 @@ describe('Sidebar', () => { [ONYXKEYS.BETAS]: betas, [ONYXKEYS.NVP_PRIORITY_MODE]: CONST.PRIORITY_MODE.GSD, [ONYXKEYS.PERSONAL_DETAILS_LIST]: LHNTestUtils.fakePersonalDetails, - [ONYXKEYS.RAM_ONLY_IS_LOADING_APP]: false, + [ONYXKEYS.IS_LOADING_APP]: false, ...reportNameValuePairsCollection, ...reportCollection, ...reportAction, From 462346408beb7dafe0df12623813c79cbd734499 Mon Sep 17 00:00:00 2001 From: Julian Kobrynski Date: Wed, 8 Apr 2026 09:00:23 +0200 Subject: [PATCH 3/6] Revert PLAID_LINK_TOKEN changes to fix endless spinner in Plaid flow --- src/components/AddPlaidBankAccount.tsx | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/components/AddPlaidBankAccount.tsx b/src/components/AddPlaidBankAccount.tsx index fc011a18ee2a..c68624505d5a 100644 --- a/src/components/AddPlaidBankAccount.tsx +++ b/src/components/AddPlaidBankAccount.tsx @@ -83,19 +83,18 @@ function AddPlaidBankAccount({ const subscribedKeyboardShortcuts = useRef void>>([]); const previousNetworkState = useRef(undefined); const [selectedPlaidAccountMask, setSelectedPlaidAccountMask] = useState(defaultSelectedPlaidAccountMask); - const [plaidLinkToken] = useOnyx(ONYXKEYS.PLAID_LINK_TOKEN); - const [isPlaidTokenReady, setIsPlaidTokenReady] = useState(false); + const [plaidLinkToken] = useOnyx(ONYXKEYS.PLAID_LINK_TOKEN, {initWithStoredValues: false}); const [isPlaidDisabled] = useOnyx(ONYXKEYS.IS_PLAID_DISABLED); const {translate} = useLocalize(); const {isOffline} = useNetwork(); const getPlaidLinkToken = (): string | undefined => { - if (receivedRedirectURI && plaidLinkOAuthToken) { - return plaidLinkOAuthToken; + if (plaidLinkToken) { + return plaidLinkToken; } - if (isPlaidTokenReady && plaidLinkToken) { - return plaidLinkToken; + if (receivedRedirectURI && plaidLinkOAuthToken) { + return plaidLinkOAuthToken; } }; @@ -141,11 +140,9 @@ function AddPlaidBankAccount({ // If we're coming from Plaid OAuth flow then we need to reuse the existing plaidLinkToken if (isAuthenticatedWithPlaid()) { - setIsPlaidTokenReady(true); return unsubscribeToNavigationShortcuts; } openPlaidBankLogin(allowDebit, bankAccountID); - setIsPlaidTokenReady(true); return unsubscribeToNavigationShortcuts; // disabling this rule, as we want this to run only on the first render From d5350eadbd3d8b704ed2f3bf22fed12d82a3fb30 Mon Sep 17 00:00:00 2001 From: Julian Kobrynski Date: Wed, 8 Apr 2026 09:07:44 +0200 Subject: [PATCH 4/6] Revert IS_LOADING_REPORT_DATA RAM-only migration to prevent potential offline loading issues --- src/ONYXKEYS.ts | 4 ++-- src/components/PriorityModeController.tsx | 2 +- src/libs/actions/App.ts | 8 ++++---- src/libs/actions/Welcome/index.ts | 2 +- src/pages/ConciergePage.tsx | 2 +- src/pages/home/ForYouSection/index.tsx | 2 +- src/pages/home/HomePage.tsx | 2 +- src/pages/inbox/ReportFetchHandler.tsx | 2 +- src/pages/inbox/ReportNotFoundGuard.tsx | 2 +- .../inbox/report/withReportAndReportActionOrNotFound.tsx | 2 +- src/pages/inbox/report/withReportOrNotFound.tsx | 2 +- src/pages/inbox/sidebar/SidebarLinks.tsx | 2 +- .../Profile/Contacts/ContactMethodDetailsPage.tsx | 2 +- src/pages/workspace/AccessOrNotFoundWrapper.tsx | 2 +- src/pages/workspace/withPolicyAndFullscreenLoading.tsx | 2 +- src/setup/index.ts | 1 - tests/actions/ReportTest.ts | 6 +++--- tests/perf-test/SidebarLinks.perf-test.tsx | 4 ++-- tests/ui/WorkspaceWorkflowsApprovalsEditPageTest.tsx | 2 +- tests/unit/ContactMethodDetailsPageTest.tsx | 2 +- tests/unit/ReportActionItemSingleTest.ts | 2 +- 21 files changed, 27 insertions(+), 28 deletions(-) diff --git a/src/ONYXKEYS.ts b/src/ONYXKEYS.ts index 08fe90189696..ec8cad104cf9 100755 --- a/src/ONYXKEYS.ts +++ b/src/ONYXKEYS.ts @@ -373,7 +373,7 @@ const ONYXKEYS = { SHARE_BANK_ACCOUNT: 'shareBankAccount', /** Is report data loading? */ - RAM_ONLY_IS_LOADING_REPORT_DATA: 'isLoadingReportData', + IS_LOADING_REPORT_DATA: 'isLoadingReportData', /** Set when we are loading bank accounts for share page */ IS_LOADING_SHARE_BANK_ACCOUNTS: 'isLoadingShareBankAccounts', @@ -1399,7 +1399,7 @@ type OnyxValuesMapping = { [ONYXKEYS.IS_LOADING_SHARE_BANK_ACCOUNTS]: boolean; [ONYXKEYS.IS_LOADING_BULK_CHANGE_APPROVER_PAGE]: boolean; [ONYXKEYS.IS_LOADING_POLICY_CODING_RULES_PREVIEW]: boolean; - [ONYXKEYS.RAM_ONLY_IS_LOADING_REPORT_DATA]: boolean; + [ONYXKEYS.IS_LOADING_REPORT_DATA]: boolean; [ONYXKEYS.IS_SEARCH_FILTERS_CARD_DATA_LOADED]: boolean; [ONYXKEYS.IS_LOADING_SUBSCRIPTION_DATA]: boolean; [ONYXKEYS.IS_SEARCH_PAGE_DATA_LOADED]: boolean; diff --git a/src/components/PriorityModeController.tsx b/src/components/PriorityModeController.tsx index 02b3ec8b3609..bbed955ea936 100644 --- a/src/components/PriorityModeController.tsx +++ b/src/components/PriorityModeController.tsx @@ -30,7 +30,7 @@ const isInFocusModeSelector = (priorityMode: OnyxEntry { isLoadingReportData = value ?? false; checkServerDataReady(); diff --git a/src/pages/ConciergePage.tsx b/src/pages/ConciergePage.tsx index 144e7bcf41dc..2b3a804391f5 100644 --- a/src/pages/ConciergePage.tsx +++ b/src/pages/ConciergePage.tsx @@ -24,7 +24,7 @@ function ConciergePage() { const styles = useThemeStyles(); const isUnmounted = useRef(false); const [session] = useOnyx(ONYXKEYS.SESSION); - const [isLoadingReportData = true] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_REPORT_DATA); + const [isLoadingReportData = true] = useOnyx(ONYXKEYS.IS_LOADING_REPORT_DATA); const [conciergeReportID] = useOnyx(ONYXKEYS.CONCIERGE_REPORT_ID); const [introSelected] = useOnyx(ONYXKEYS.NVP_INTRO_SELECTED); const [betas] = useOnyx(ONYXKEYS.BETAS); diff --git a/src/pages/home/ForYouSection/index.tsx b/src/pages/home/ForYouSection/index.tsx index 55703ad04dfe..ac4074b2224c 100644 --- a/src/pages/home/ForYouSection/index.tsx +++ b/src/pages/home/ForYouSection/index.tsx @@ -26,7 +26,7 @@ function ForYouSection() { const {shouldUseNarrowLayout} = useResponsiveLayout(); const [accountID] = useOnyx(ONYXKEYS.SESSION, {selector: accountIDSelector}); const [isLoadingApp = true] = useOnyx(ONYXKEYS.IS_LOADING_APP); - const [isLoadingReportData = false] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_REPORT_DATA); + const [isLoadingReportData = false] = useOnyx(ONYXKEYS.IS_LOADING_REPORT_DATA); const [reportCounts = CONST.EMPTY_TODOS_REPORT_COUNTS] = useOnyx(ONYXKEYS.DERIVED.TODOS, {selector: todosReportCountsSelector}); const [singleReportIDs = EMPTY_TODOS_SINGLE_REPORT_IDS] = useOnyx(ONYXKEYS.DERIVED.TODOS, {selector: todosSingleReportIDsSelector}); diff --git a/src/pages/home/HomePage.tsx b/src/pages/home/HomePage.tsx index 450686c48ed7..070a210ef1c2 100644 --- a/src/pages/home/HomePage.tsx +++ b/src/pages/home/HomePage.tsx @@ -32,7 +32,7 @@ function HomePage() { const {translate} = useLocalize(); useDocumentTitle(translate('common.home')); const [isLoadingApp = true] = useOnyx(ONYXKEYS.IS_LOADING_APP); - const [isLoadingReportData = false] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_REPORT_DATA); + const [isLoadingReportData = false] = useOnyx(ONYXKEYS.IS_LOADING_REPORT_DATA); const isForYouLoading = !!(isLoadingApp || isLoadingReportData); const receiptDropTargetRef = useRef(null); diff --git a/src/pages/inbox/ReportFetchHandler.tsx b/src/pages/inbox/ReportFetchHandler.tsx index c36b82c082dd..c15aa9a2e6bf 100644 --- a/src/pages/inbox/ReportFetchHandler.tsx +++ b/src/pages/inbox/ReportFetchHandler.tsx @@ -75,7 +75,7 @@ function ReportFetchHandler() { const [betas] = useOnyx(ONYXKEYS.BETAS); const [onboarding] = useOnyx(ONYXKEYS.NVP_ONBOARDING); const [isLoadingApp] = useOnyx(ONYXKEYS.IS_LOADING_APP); - const [isLoadingReportData = true] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_REPORT_DATA); + const [isLoadingReportData = true] = useOnyx(ONYXKEYS.IS_LOADING_REPORT_DATA); const prevIsLoadingReportData = usePrevious(isLoadingReportData); const reportID = reportOnyx?.reportID; diff --git a/src/pages/inbox/ReportNotFoundGuard.tsx b/src/pages/inbox/ReportNotFoundGuard.tsx index 7d599068bd84..c5ce99b3becf 100644 --- a/src/pages/inbox/ReportNotFoundGuard.tsx +++ b/src/pages/inbox/ReportNotFoundGuard.tsx @@ -36,7 +36,7 @@ function ReportNotFoundGuard({children}: ReportNotFoundGuardProps) { const [isLoadingInitialReportActions = true] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT_METADATA}${reportIDFromRoute}`, { selector: isLoadingInitialReportActionsSelector, }); - const [isLoadingReportData = true] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_REPORT_DATA); + const [isLoadingReportData = true] = useOnyx(ONYXKEYS.IS_LOADING_REPORT_DATA); const [isLoadingApp] = useOnyx(ONYXKEYS.IS_LOADING_APP); const [deleteTransactionNavigateBackUrl] = useOnyx(ONYXKEYS.NVP_DELETE_TRANSACTION_NAVIGATE_BACK_URL); diff --git a/src/pages/inbox/report/withReportAndReportActionOrNotFound.tsx b/src/pages/inbox/report/withReportAndReportActionOrNotFound.tsx index 485f94b7d6e7..512f85882ed9 100644 --- a/src/pages/inbox/report/withReportAndReportActionOrNotFound.tsx +++ b/src/pages/inbox/report/withReportAndReportActionOrNotFound.tsx @@ -43,7 +43,7 @@ export default function { ReportActionContextMenu.hideContextMenu(false); diff --git a/src/pages/settings/Profile/Contacts/ContactMethodDetailsPage.tsx b/src/pages/settings/Profile/Contacts/ContactMethodDetailsPage.tsx index 3a6d475e2d83..b7aaedcf1d21 100644 --- a/src/pages/settings/Profile/Contacts/ContactMethodDetailsPage.tsx +++ b/src/pages/settings/Profile/Contacts/ContactMethodDetailsPage.tsx @@ -58,7 +58,7 @@ function ContactMethodDetailsPage({route}: ContactMethodDetailsPageProps) { const [session, sessionResult] = useOnyx(ONYXKEYS.SESSION); const [myDomainSecurityGroups, myDomainSecurityGroupsResult] = useOnyx(ONYXKEYS.MY_DOMAIN_SECURITY_GROUPS); const [securityGroups, securityGroupsResult] = useOnyx(ONYXKEYS.COLLECTION.SECURITY_GROUP); - const [isLoadingReportData = true, isLoadingReportDataResult] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_REPORT_DATA); + const [isLoadingReportData = true, isLoadingReportDataResult] = useOnyx(ONYXKEYS.IS_LOADING_REPORT_DATA); const [allPolicies] = useOnyx(ONYXKEYS.COLLECTION.POLICY); const [isValidateCodeFormVisible, setIsValidateCodeFormVisible] = useState(true); const {isActingAsDelegate} = useDelegateNoAccessState(); diff --git a/src/pages/workspace/AccessOrNotFoundWrapper.tsx b/src/pages/workspace/AccessOrNotFoundWrapper.tsx index 278ddeef6377..2a38f0a58292 100644 --- a/src/pages/workspace/AccessOrNotFoundWrapper.tsx +++ b/src/pages/workspace/AccessOrNotFoundWrapper.tsx @@ -144,7 +144,7 @@ function AccessOrNotFoundWrapper({ }: AccessOrNotFoundWrapperProps) { const [report] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${reportID}`); const [policy] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${policyID}`); - const [isLoadingReportData = true] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_REPORT_DATA); + const [isLoadingReportData = true] = useOnyx(ONYXKEYS.IS_LOADING_REPORT_DATA); const {login = ''} = useCurrentUserPersonalDetails(); const {isRestrictedToPreferredPolicy} = usePreferredPolicy(); const [betas] = useOnyx(ONYXKEYS.BETAS); diff --git a/src/pages/workspace/withPolicyAndFullscreenLoading.tsx b/src/pages/workspace/withPolicyAndFullscreenLoading.tsx index b7dbb5b7a9c0..83e6399910cc 100644 --- a/src/pages/workspace/withPolicyAndFullscreenLoading.tsx +++ b/src/pages/workspace/withPolicyAndFullscreenLoading.tsx @@ -33,7 +33,7 @@ export default function withPolicyAndFullscreenLoading) { - const [isLoadingReportData = true] = useOnyx(ONYXKEYS.RAM_ONLY_IS_LOADING_REPORT_DATA); + const [isLoadingReportData = true] = useOnyx(ONYXKEYS.IS_LOADING_REPORT_DATA); const [personalDetails] = useOnyx(ONYXKEYS.PERSONAL_DETAILS_LIST); if ((isLoadingPolicy || isLoadingReportData) && isEmpty(policy) && isEmpty(policyDraft)) { diff --git a/src/setup/index.ts b/src/setup/index.ts index c589c291eb8b..49785d8449ff 100644 --- a/src/setup/index.ts +++ b/src/setup/index.ts @@ -64,7 +64,6 @@ export default function () { ONYXKEYS.RAM_ONLY_ARE_TRANSLATIONS_LOADING, ONYXKEYS.RAM_ONLY_MOBILE_SELECTION_MODE, ONYXKEYS.RAM_ONLY_IS_SIDEBAR_LOADED, - ONYXKEYS.RAM_ONLY_IS_LOADING_REPORT_DATA, ONYXKEYS.COLLECTION.RAM_ONLY_ISSUE_NEW_EXPENSIFY_CARD, ONYXKEYS.DERIVED.RAM_ONLY_SORTED_REPORT_ACTIONS, ONYXKEYS.RAM_ONLY_UPDATE_AVAILABLE, diff --git a/tests/actions/ReportTest.ts b/tests/actions/ReportTest.ts index 6be03c194683..4c2ab3c6c532 100644 --- a/tests/actions/ReportTest.ts +++ b/tests/actions/ReportTest.ts @@ -3984,7 +3984,7 @@ describe('actions/Report', () => { it('should handle undefined conciergeReportID gracefully', async () => { // Don't set CONCIERGE_REPORT_ID to simulate undefined state - await Onyx.set(ONYXKEYS.RAM_ONLY_IS_LOADING_REPORT_DATA, false); + await Onyx.set(ONYXKEYS.IS_LOADING_REPORT_DATA, false); await waitForBatchedUpdates(); // When conciergeReportID is undefined, the function uses onServerDataReady() @@ -4113,7 +4113,7 @@ describe('actions/Report', () => { }); it('should not throw with any isSelfTourViewed value when conciergeReportID is undefined', async () => { - await Onyx.set(ONYXKEYS.RAM_ONLY_IS_LOADING_REPORT_DATA, false); + await Onyx.set(ONYXKEYS.IS_LOADING_REPORT_DATA, false); await waitForBatchedUpdates(); expect(() => { @@ -4247,7 +4247,7 @@ describe('actions/Report', () => { }); it('should handle undefined conciergeReportID by using fallback navigation', async () => { - await Onyx.set(ONYXKEYS.RAM_ONLY_IS_LOADING_REPORT_DATA, false); + await Onyx.set(ONYXKEYS.IS_LOADING_REPORT_DATA, false); await waitForBatchedUpdates(); expect(() => { diff --git a/tests/perf-test/SidebarLinks.perf-test.tsx b/tests/perf-test/SidebarLinks.perf-test.tsx index e8ce7d087c6b..0be24cc82032 100644 --- a/tests/perf-test/SidebarLinks.perf-test.tsx +++ b/tests/perf-test/SidebarLinks.perf-test.tsx @@ -80,7 +80,7 @@ describe('SidebarLinks', () => { [ONYXKEYS.PERSONAL_DETAILS_LIST]: LHNTestUtils.fakePersonalDetails, [ONYXKEYS.BETAS]: [CONST.BETAS.DEFAULT_ROOMS], [ONYXKEYS.NVP_PRIORITY_MODE]: CONST.PRIORITY_MODE.GSD, - [ONYXKEYS.RAM_ONLY_IS_LOADING_REPORT_DATA]: false, + [ONYXKEYS.IS_LOADING_REPORT_DATA]: false, ...mockedResponseMap, }); @@ -102,7 +102,7 @@ describe('SidebarLinks', () => { [ONYXKEYS.PERSONAL_DETAILS_LIST]: LHNTestUtils.fakePersonalDetails, [ONYXKEYS.BETAS]: [CONST.BETAS.DEFAULT_ROOMS], [ONYXKEYS.NVP_PRIORITY_MODE]: CONST.PRIORITY_MODE.GSD, - [ONYXKEYS.RAM_ONLY_IS_LOADING_REPORT_DATA]: false, + [ONYXKEYS.IS_LOADING_REPORT_DATA]: false, ...mockedResponseMap, }); diff --git a/tests/ui/WorkspaceWorkflowsApprovalsEditPageTest.tsx b/tests/ui/WorkspaceWorkflowsApprovalsEditPageTest.tsx index cc95606c447c..ef462e550190 100644 --- a/tests/ui/WorkspaceWorkflowsApprovalsEditPageTest.tsx +++ b/tests/ui/WorkspaceWorkflowsApprovalsEditPageTest.tsx @@ -96,7 +96,7 @@ describe('WorkspaceWorkflowsApprovalsEditPage', () => { await act(async () => { await Onyx.clear(); await Onyx.set(ONYXKEYS.HAS_LOADED_APP, true); - await Onyx.set(ONYXKEYS.RAM_ONLY_IS_LOADING_REPORT_DATA, false); + await Onyx.set(ONYXKEYS.IS_LOADING_REPORT_DATA, false); const policy = buildPolicy(); const personalDetails = buildPersonalDetailsList(); diff --git a/tests/unit/ContactMethodDetailsPageTest.tsx b/tests/unit/ContactMethodDetailsPageTest.tsx index 81552509fd9a..5ab3fc7a6e26 100644 --- a/tests/unit/ContactMethodDetailsPageTest.tsx +++ b/tests/unit/ContactMethodDetailsPageTest.tsx @@ -134,7 +134,7 @@ describe('ContactMethodDetailsPage', () => { it('calls Navigation.goBack when contact method becomes validated and screen is focused', async () => { Onyx.merge(ONYXKEYS.SESSION, {email: fakeEmail}); - Onyx.merge(ONYXKEYS.RAM_ONLY_IS_LOADING_REPORT_DATA, false); + Onyx.merge(ONYXKEYS.IS_LOADING_REPORT_DATA, false); Onyx.merge(ONYXKEYS.LOGIN_LIST, { [fakeEmail]: { partnerName: 'expensify.com', diff --git a/tests/unit/ReportActionItemSingleTest.ts b/tests/unit/ReportActionItemSingleTest.ts index 3115a9c7cc77..8d400c96b510 100644 --- a/tests/unit/ReportActionItemSingleTest.ts +++ b/tests/unit/ReportActionItemSingleTest.ts @@ -56,7 +56,7 @@ describe('ReportActionItemSingle', () => { await act(async () => { await Onyx.multiSet({ [ONYXKEYS.PERSONAL_DETAILS_LIST]: fakePersonalDetails, - [ONYXKEYS.RAM_ONLY_IS_LOADING_REPORT_DATA]: false, + [ONYXKEYS.IS_LOADING_REPORT_DATA]: false, [ONYXKEYS.COLLECTION.REPORT_ACTIONS]: { [`${ONYXKEYS.COLLECTION.REPORT_ACTIONS}${fakeReport.reportID}`]: { [fakeReportAction.reportActionID]: fakeReportAction, From fae14a22c20719bc54be83cb6256d544e9ad7bd2 Mon Sep 17 00:00:00 2001 From: Julian Kobrynski Date: Thu, 9 Apr 2026 09:53:23 +0200 Subject: [PATCH 5/6] Revert unrelated IS_LOADING_APP and IS_LOADING_REPORT_DATA changes --- src/libs/actions/Welcome/index.ts | 1 + .../routes/WorkspaceAvatarModalContent.tsx | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libs/actions/Welcome/index.ts b/src/libs/actions/Welcome/index.ts index 128d0d29f178..a10f96e62a8e 100644 --- a/src/libs/actions/Welcome/index.ts +++ b/src/libs/actions/Welcome/index.ts @@ -116,6 +116,7 @@ function completeHybridAppOnboarding() { // and doesn't need to trigger component re-renders. Onyx.connectWithoutView({ key: ONYXKEYS.IS_LOADING_REPORT_DATA, + initWithStoredValues: false, callback: (value) => { isLoadingReportData = value ?? false; checkServerDataReady(); diff --git a/src/pages/media/AttachmentModalScreen/routes/WorkspaceAvatarModalContent.tsx b/src/pages/media/AttachmentModalScreen/routes/WorkspaceAvatarModalContent.tsx index f1e2083d3cab..70fa08ede752 100644 --- a/src/pages/media/AttachmentModalScreen/routes/WorkspaceAvatarModalContent.tsx +++ b/src/pages/media/AttachmentModalScreen/routes/WorkspaceAvatarModalContent.tsx @@ -16,7 +16,7 @@ function WorkspaceAvatarModalContent({navigation, route}: AttachmentModalScreenP const defaultAvatars = useDefaultAvatars(); const policy = usePolicy(policyID); - const [isLoadingApp = false] = useOnyx(ONYXKEYS.IS_LOADING_APP); + const [isLoadingApp = false] = useOnyx(ONYXKEYS.IS_LOADING_APP, {initWithStoredValues: false}); const avatarURL = policy?.avatarURL ?? getDefaultWorkspaceAvatar(policy?.name ?? fallbackLetter); const source = getFullSizeAvatar({avatarSource: avatarURL, defaultAvatars}); From 009717077668983a24c804a3af590bd057b35dc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A1bio=20Henriques?= Date: Tue, 14 Apr 2026 09:08:50 +0100 Subject: [PATCH 6/6] Fix EnablePayments.tsx to handle isLoading state from optimistic data --- src/pages/EnablePayments/EnablePayments.tsx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/pages/EnablePayments/EnablePayments.tsx b/src/pages/EnablePayments/EnablePayments.tsx index a4d8ee60bbfd..abacc0da2d83 100644 --- a/src/pages/EnablePayments/EnablePayments.tsx +++ b/src/pages/EnablePayments/EnablePayments.tsx @@ -35,13 +35,11 @@ function EnablePaymentsPage() { return; } - if (isEmptyObject(userWallet)) { - openEnablePaymentsPage(); - } - }, [isOffline, userWallet]); + openEnablePaymentsPage(); + }, [isOffline]); const isUserWalletEmpty = isEmptyObject(userWallet); - if (isUserWalletEmpty) { + if (isUserWalletEmpty || userWallet?.isLoading) { const reasonAttributes: SkeletonSpanReasonAttributes = { context: 'EnablePaymentsPage', isUserWalletEmpty,