You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Due for payment 2025-07-14] [$250] Web/Safari - 2FA - The 2FA page with the 6-digit code requested is not fully displayed #64404
Version Number: v9.1.68-2 Reproducible in staging?: Yes Reproducible in production?: Yes If this was caught during regression testing, add the test name, ID and link from TestRail: n/a Email or phone of affected tester (no customers): n/a Issue reported by: Applause Internal Team Device used: Mac 15.4.1/Safari App Component: User Settings
The 2FA verifying page is fully displayed when enabling 2FA.
Actual Result:
The 2FA page with the 6-digit code requested is not fully displayed when enabling 2FA. The page appears after clicking any button. Sometimes the page is blank
In these cases, Safari tries to scroll the input into view but miscalculates the horizontal position, causing a phantom horizontal scroll and layout shift.
What changes do you think we should make in order to solve the problem?
We should avoid using autoFocus directly in JSX for Safari. Instead, detect Safari using the user agent and manually focus the input with a short delay to allow the layout to stabilize after navigation. This prevents Safari from performing its buggy scroll behavior.
Example fix:
constonFocus=()=>{if(!shouldFocusLast.current){return;}lastValue.current=TEXT_INPUT_EMPTY_STATE;setInputAndIndex(lastFocusedIndex.current);};useEffect(()=>{if(!autoFocus){return;}constisSafari=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);if(isSafari){setTimeout(()=>{onFocus();inputRef.current?.focus();// innerRef from props},300);// give time for layout to settle}else{onFocus();inputRef.current?.focus();}},[]);
and remove the autoFocus={autoFocus} and onFocus={onFocus} props from TextInput.
What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
None
What alternative solutions did you explore? (Optional)
changed the title [-]Web/Safari - 2FA - The 2FA page with the 6-digit code requested is not fully displayed[/-][+][$250] Web/Safari - 2FA - The 2FA page with the 6-digit code requested is not fully displayed[/+]on Jun 23, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.76-5 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
@DylanDylann@isabelastisser The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]
1a. Result of the original design (eg. a case wasn't considered)
1b. Mistake during implementation
1c. Backend bug
1z. Other:
Where bug was reported:
2a. Reported on production (eg. bug slipped through the normal regression and PR testing process on staging)
2b. Reported on staging (eg. found during regression or PR testing)
2d. Reported on a PR
2z. Other:
Who reported the bug:
3a. Expensify user
3b. Expensify employee
3c. Contributor
3d. QA
3z. Other:
[Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
Link to comment:
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion:
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
Regression Test Proposal Template
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
1a. Result of the original design (eg. a case wasn't considered)
1b. Mistake during implementation
1c. Backend bug
1z. Other:
Where bug was reported:
2a. Reported on production (eg. bug slipped through the normal regression and PR testing process on staging)
2b. Reported on staging (eg. found during regression or PR testing)
2d. Reported on a PR
2z. Other:
Who reported the bug:
3a. Expensify user
3b. Expensify employee
3c. Contributor
3d. QA
3z. Other:
[Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
Link to comment: This is a case wasn't considered while implementing the feature
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion:
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Activity
melvin-bot commentedon Jun 18, 2025
Triggered auto assignment to @isabelastisser (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.nabi-ebrahimi commentedon Jun 18, 2025
Proposal
Please re-state the problem that we are trying to solve in this issue.
Web/Safari - 2FA - The 2FA page with the 6-digit code requested is not fully displayed
What is the root cause of that problem?
Safari handles input focus poorly when:
App/src/pages/settings/Security/TwoFactorAuth/VerifyPage.tsx
Lines 120 to 136 in f6efb52
ScrollView.App/src/pages/settings/Security/TwoFactorAuth/VerifyPage.tsx
Lines 84 to 119 in f6efb52
App/src/components/MagicCodeInput.tsx
Line 399 in f6efb52
In these cases, Safari tries to scroll the input into view but miscalculates the horizontal position, causing a phantom horizontal scroll and layout shift.
What changes do you think we should make in order to solve the problem?
We should avoid using
autoFocusdirectly in JSX for Safari. Instead, detect Safari using the user agent and manually focus the input with a short delay to allow the layout to stabilize after navigation. This prevents Safari from performing its buggy scroll behavior.Example fix:
and remove the
autoFocus={autoFocus}andonFocus={onFocus}props fromTextInput.What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
None
What alternative solutions did you explore? (Optional)
twisterdotcom commentedon Jun 18, 2025
Following my advice here: #63663 (comment).
This appears to be an exploitative bug, not one linked to a PR, regression test or customer report, so likely closing.
twisterdotcom commentedon Jun 19, 2025
Hmm, this one is pretty bad actually right?
melvin-bot commentedon Jun 23, 2025
@isabelastisser Whoops! This issue is 2 days overdue. Let's get this updated quick!
[-]Web/Safari - 2FA - The 2FA page with the 6-digit code requested is not fully displayed[/-][+][$250] Web/Safari - 2FA - The 2FA page with the 6-digit code requested is not fully displayed[/+]21 remaining items
melvin-bot commentedon Jul 7, 2025
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.1.76-5 and is now subject to a 7-day regression period 📆. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2025-07-14. 🎊
For reference, here are some details about the assignees on this issue:
melvin-bot commentedon Jul 7, 2025
@DylanDylann @isabelastisser The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed. Please copy/paste the BugZero Checklist from here into a new comment on this GH and complete it. If you have the K2 extension, you can simply click: [this button]
isabelastisser commentedon Jul 16, 2025
BugZero Checklist:
Bug classification
Source of bug:
Where bug was reported:
Who reported the bug:
[Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
Link to comment:
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion:
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
Regression Test Proposal Template
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue:
Regression Test Proposal
Precondition:
Test:
Do we agree 👍 or 👎
isabelastisser commentedon Jul 16, 2025
@DylanDylann, can you please complete the checklist? thanks!
isabelastisser commentedon Jul 16, 2025
Payment summary:
@DylanDylann requires payment through NewDot Manual Requests $250 for C+ review
@thelullabyy paid in Upwork automatic offer (Contributor)
DylanDylann commentedon Jul 16, 2025
BugZero Checklist:
Bug classification
Source of bug:
Where bug was reported:
Who reported the bug:
[Contributor] The offending PR has been commented on, pointing out the bug it caused and why, so the author and reviewers can learn from the mistake.
Link to comment: This is a case wasn't considered while implementing the feature
[Contributor] If the regression was CRITICAL (e.g. interrupts a core flow) A discussion in #expensify-open-source has been started about whether any other steps should be taken (e.g. updating the PR review checklist) in order to catch this type of bug sooner.
Link to discussion:
[Contributor] If it was decided to create a regression test for the bug, please propose the regression test steps using the template below to ensure the same bug will not reach production again.
[BugZero Assignee] Create a GH issue for creating/updating the regression test once above steps have been agreed upon.
Link to issue:
Regression Test Proposal
Test:
Do we agree 👍 or 👎
isabelastisser commentedon Jul 16, 2025
All set!
JmillsExpensify commentedon Oct 14, 2025
$250 approved for @DylanDylann
quinthar commentedon Oct 16, 2025
$250 to @DylanDylann