-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[$250] DEV : When clicking to send the magic code to verify the secondary email, a blank page appears briefly before the page to enter the code. #53884
Comments
Triggered auto assignment to @MitchExpensify ( |
This has been labelled "Needs Reproduction". Follow the steps here: https://stackoverflowteams.com/c/expensify/questions/16989 |
Edited by proposal-police: This proposal was edited at 2025-01-03 10:07:29 UTC. ProposalPlease re-state the problem that we are trying to solve in this issue.When entering one of contacts, RHP modal opens twice. What is the root cause of that problem?App/src/pages/settings/Profile/Contacts/ContactMethodDetailsPage.tsx Lines 239 to 276 in f8f12c2
Though this details page is opened as a modal already, <ValidateCodeActionModal> forces to open another modal in the modal.
What changes do you think we should make in order to solve the problem?Since
We bring these App/src/components/ValidateCodeActionModal/index.tsx Lines 39 to 43 in 83aae80
We bring these from App/src/components/ValidateCodeActionModal/index.tsx Lines 45 to 52 in 83aae80
Then the code in details page would look like: const hide = useCallback(() => {
User.clearContactMethodErrors(contactMethod, !isEmptyObject(validateLoginError) ? 'validateLogin' : 'validateCodeSent')
Navigation.goBack(ROUTES.SETTINGS_CONTACT_METHODS.getRoute(backTo));
firstRenderRef.current = true;
}, [])
const isVisible = isValidateCodeActionModalVisible && !loginData?.validatedDate && !!loginData;
useEffect(() => {
setIsValidateCodeActionModalVisible(!loginData?.validatedDate);
if (!firstRenderRef.current || isVisible || loginData?.validateCodeSent) {
return;
}
User.requestContactMethodValidateCode(contactMethod)
firstRenderRef.current = false;
}, [loginData?.validatedDate, loginData?.errorFields?.addedLogin]);
<ScrollView
contentContainerStyle={themeStyles.flex1}
keyboardShouldPersistTaps="handled"
>
...
<ValidateCodeForm
...
{!loginData?.validatedDate && <ValidateCodeForm/>} We should replace Then the fix code would look like: {!loginData?.validatedDate
<View style={[themeStyles.ph5, themeStyles.mt3, themeStyles.mb5, themeStyles.flex1]}>
<Text style={[themeStyles.mb3]}>{translate('contacts.enterMagicCode', {contactMethod})}</Text>
<ValidateCodeForm
validateCodeAction={validateCodeAction}
validatePendingAction={loginData.pendingFields?.validateCodeSent}
validateError={!isEmptyObject(validateLoginError) ? validateLoginError : ErrorUtils.getLatestErrorField(loginData, 'validateCodeSent')}
handleSubmitForm={(validateCode) => User.validateSecondaryLogin(loginList, contactMethod, validateCode)}
sendValidateCode={() => User.requestContactMethodValidateCode(contactMethod)}
clearError={() => User.clearContactMethodErrors(contactMethod, !isEmptyObject(validateLoginError) ? 'validateLogin' : 'validateCodeSent')}
buttonStyles={[themeStyles.justifyContentEnd, themeStyles.flex1]}
ref={validateCodeFormRef}
hasMagicCodeBeenSent={hasMagicCodeBeenSent}
/>
</View>
} You can browse test code here. What alternative solutions did you explore? (Optional)N/A |
I can reproduce it. Actually, it's hard to see the blank page on my end because the blank page will be hidden almost immediately when navigating to the secondary email. However, it's easy to reproduce if we record it and then watch it closely. Click here to view recordingsScreen.Recording.2024-12-11.at.17.22.21.mov |
Job added to Upwork: https://www.upwork.com/jobs/~021867385191571001621 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @ZhenjaHorbach ( |
@hoangzinh |
yes, I do @ZhenjaHorbach ❤️. @MitchExpensify can you assign this issue to me as a C+ as I was able to reproduce it? Thank you. |
ProposalPlease re-state the problem that we are trying to solve in this issue.
What is the root cause of that problem?
What changes do you think we should make in order to solve the problem?
{shouldShowModal ? (
<FullScreenLoadingIndicator />
) : (
<HeaderWithBackButton
title={formattedContactMethod}
onBackButtonPress={() => Navigation.goBack(ROUTES.SETTINGS_CONTACT_METHODS.getRoute(backTo))}
/>
)} instead of: App/src/pages/settings/Profile/Contacts/ContactMethodDetailsPage.tsx Lines 243 to 246 in f8f12c2
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?What alternative solutions did you explore? (Optional) |
@MitchExpensify Whoops! This issue is 2 days overdue. Let's get this updated quick! |
Done, what do you think of the proposal above, @hoangzinh ? |
Ah I'm reviewing proposals. Btw, @MitchExpensify could you help to remove |
@hoangzinh, @MitchExpensify Whoops! This issue is 2 days overdue. Let's get this updated quick! |
Same as above. Awaiting for proposals |
@hoangzinh, @MitchExpensify Uh oh! This issue is overdue by 2 days. Don't forget to update your issues! |
Still awaiting for proposals |
Proposal |
@hoangzinh Could you please to check? I have edited my proposal and here is recording result: expensify-test5-bug-2025-01-03_19.12.58.mp4 |
@jacobkim9881 looks promise. Btw, the reason why we want to use |
@hoangzinh I haven't even imagined that logics from modal could make issues. Let me check if any logic bothers the details page. |
@hoangzinh @MitchExpensify this issue is now 4 weeks old, please consider:
Thanks! |
@jacobkim9881 no, I mean if we copy some logic of |
@hoangzinh I understood. Then I think we can make the logic as a hook and put it into |
Another option is we can somehow make another version of App/src/components/ValidateCodeActionModal/index.tsx Lines 33 to 55 in a530d9f
among them. Then other pages have same issue can just plug&play this new version of |
@hoangzinh So a component to be used w/o modal? It will share validate code form and will be placed in details page. If I understood then let me try to code. |
Yeah, what do you think? The main point is we can reuse in other pages if they have same issue |
@hoangzinh Then the new component will have back button and validate form. It should be switchable in details page with menu items. |
or it can be a pure component that can be inject into any existing page/screen |
Yes. A pure component can be placed in any page. In the other hand, |
@jacobkim9881 yeah. LMK when you have a working solution for those approaches, also update your proposal with either of them. |
About this comment,
I think I should write my proposal better. The methods in const hide = useCallback(() => {
User.clearContactMethodErrors(contactMethod, !isEmptyObject(validateLoginError) ? 'validateLogin' : 'validateCodeSent')
Navigation.goBack(ROUTES.SETTINGS_CONTACT_METHODS.getRoute(backTo));
firstRenderRef.current = true;
}, [backTo, contactMethod, validateLoginError]) are necessary for details page but I don't think it will be needed in the modal page. So it should be written in details page only. |
Yeah @jacobkim9881. So your current approach is moving "hide" and "sendCode" from <ValidateCodeActionWithoutModal
...
clearError={() => User.clearContactMethodErrors(contactMethod, !isEmptyObject(validateLoginError) ? 'validateLogin' : 'validateCodeSent')}
onClose={() => {
Navigation.goBack(ROUTES.SETTINGS_CONTACT_METHODS.getRoute(backTo));
setIsValidateCodeActionModalVisible(false);
}}
sendValidateCode={() => User.requestContactMethodValidateCode(contactMethod)}
...
/> |
This comment has been minimized.
This comment has been minimized.
ContactMethodDetailsPage(updated 2025-01-15) While fixing I have this issue again. As a fix I have
|
@hoangzinh, @MitchExpensify Uh oh! This issue is overdue by 2 days. Don't forget to update your issues! |
@hoangzinh About the transition freezed I found one could be alternative. It is adding a option into checkCanFocusTrap: (trapContainers) => {
const results = trapContainers.map((trapContainer) => {
return new Promise((resolve) => {
const interval = setInterval(() => {
if (getComputedStyle(trapContainer).visibility !== 'hidden') {
resolve();
clearInterval(interval);
}
}, 5);
});
});
// Return a promise that resolves when all the trap containers are able to receive focus
return Promise.all(results);
}, It would look like this. As I have tested, it could let putting numbers a bit slow in the code form. Here is how to test: |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number:
Reproducible in staging?: dev
Reproducible in production?: dev
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?:
If this was caught during regression testing, add the test name, ID and link from TestRail:
Email or phone of affected tester (no customers):
Logs: https://stackoverflow.com/c/expensify/questions/4856
Expensify/Expensify Issue URL:
Issue reported by: @brunovjk
Slack conversation (hyperlinked to channel name): ts_external_expensify_bugs
Action Performed:
Expected Result:
The user is taken directly to the page to enter the code.
Actual Result:
A blank page appears briefly before navigating to the page to enter the code.
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Add any screenshot/video evidence
393837072-0b45c58f-ce4e-4e94-bad7-f7f0057d5916.mov
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @ZhenjaHorbachThe text was updated successfully, but these errors were encountered: