-
Notifications
You must be signed in to change notification settings - Fork 4k
[CP Staging] fix iOS 2FA blank screen is displayed after enabling 2FA bug #98604
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
bcae6dc
76b0c4f
9b10caa
996103c
732d131
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| diff --git a/node_modules/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/SurfaceMountingManager.kt b/node_modules/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/SurfaceMountingManager.kt | ||
| --- a/node_modules/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/SurfaceMountingManager.kt | ||
| +++ b/node_modules/react-native/ReactAndroid/src/main/java/com/facebook/react/fabric/mounting/SurfaceMountingManager.kt | ||
| @@ -899,9 +899,18 @@ internal constructor( | ||
| if (isStopped) { | ||
| return | ||
| } | ||
|
|
||
| - val viewState = getViewState(reactTag) | ||
| + val viewState = getNullableViewState(reactTag) | ||
| + if (viewState == null) { | ||
| + ReactSoftExceptionLogger.logSoftException( | ||
| + ReactSoftExceptionLogger.Categories.SURFACE_MOUNTING_MANAGER_MISSING_VIEWSTATE, | ||
| + ReactNoCrashSoftException( | ||
| + "Unable to find viewState for tag $reactTag for updateOverflowInset" | ||
| + ), | ||
| + ) | ||
| + return | ||
| + } | ||
| // Do not layout Root Views | ||
| if (viewState.isRoot) { | ||
| return | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,16 +9,32 @@ import useOnyx from './useOnyx'; | |
|
|
||
| function useIsAgentAccount(): boolean | undefined { | ||
| const accountID = useCurrentUserPersonalDetails().accountID; | ||
| const [isCustomAgent, personalDetailsMetadata] = useOnyx(ONYXKEYS.PERSONAL_DETAILS_LIST, { | ||
| selector: (personalDetails: OnyxEntry<PersonalDetailsList>) => (accountID ? personalDetails?.[accountID]?.isCustomAgent : undefined), | ||
| const [personalDetail, personalDetailsMetadata] = useOnyx(ONYXKEYS.PERSONAL_DETAILS_LIST, { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🟡 Selector now subscribes to the whole const [personalDetail, personalDetailsMetadata] = useOnyx(ONYXKEYS.PERSONAL_DETAILS_LIST, {
selector: (personalDetails: OnyxEntry<PersonalDetailsList>) => (accountID ? personalDetails?.[accountID] : undefined),
});
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I’m not sure this is a required part of the change to fix the issue. Could you please confirm?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @jakubstec would be great to follow up on this one it does feel unrelated |
||
| selector: (personalDetails: OnyxEntry<PersonalDetailsList>) => (accountID ? personalDetails?.[accountID] : undefined), | ||
| }); | ||
| const [isLoadingApp, isLoadingAppMetadata] = useOnyx(ONYXKEYS.IS_LOADING_APP); | ||
| const [hasLoadedApp, hasLoadedAppMetadata] = useOnyx(ONYXKEYS.HAS_LOADED_APP); | ||
|
|
||
| if (isLoadingApp === true || isLoadingOnyxValue(personalDetailsMetadata, isLoadingAppMetadata)) { | ||
| if (isLoadingOnyxValue(personalDetailsMetadata, isLoadingAppMetadata, hasLoadedAppMetadata)) { | ||
| return undefined; | ||
| } | ||
|
|
||
| return !!isCustomAgent; | ||
| // Identity is unknown while a load is in flight AND we can't yet trust what we have. Two loads can leave us | ||
| // without a trustworthy value: | ||
| // - Cold start: HAS_LOADED_APP hasn't flipped true yet, so even though sign-in may have already merged a | ||
| // partial personal-details entry (login, name, ...), the isCustomAgent field itself is still in flight - | ||
| // its absence isn't meaningful yet. | ||
| // - Delegate/account switch: personal details are wiped (unlike HAS_LOADED_APP, which Delegate's atomic reset | ||
| // deliberately preserves - see KEYS_TO_PRESERVE_DELEGATE_ACCESS), so a stale HAS_LOADED_APP=true must not be | ||
| // trusted while the entry is missing. | ||
| // Once both HAS_LOADED_APP is true and a personal-details entry exists, a later OpenApp or ReconnectApp | ||
| // setting IS_LOADING_APP back to true won't hide the screen again, because the identity we already have for | ||
| // this account is still valid. | ||
| if (isLoadingApp !== false && (!hasLoadedApp || personalDetail === undefined)) { | ||
| return undefined; | ||
| } | ||
|
|
||
| return !!personalDetail?.isCustomAgent; | ||
| } | ||
|
|
||
| export default useIsAgentAccount; | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jakubstec In the RN upgrade PR, the log-soft-exception-if-viewState-not-found patch is longer than this one. Is it expected? https://github.com/software-mansion-labs/expensify-app-fork/blob/5e534fa3a0d52154060bf3b5ee7f43aa84460bc9/patches/react-native/react-native%2B0.85.3%2B025%2Blog-soft-exception-if-viewState-not-found.patch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, after checking, I see that this is expected.