Repository navigation
Clear personal details form draft when backing out of the magic-code page - #96676
Conversation
Co-authored-by: Situ Chandra Shil <situchan@users.noreply.github.com>
Codecov Report✅ Changes either increased or maintained existing code coverage, great job!
|
|
There's nothing for me to push here — every real CI check is green. The only failing check is PR Author Checklist / checklist, and it's failing solely because the author checklist boxes are unticked:
This isn't a code failure and can't be resolved by a commit. It's the human checklist that you (as the co-author) need to complete after running the manual test steps and verifying on all platforms. Once the boxes are checked, the check will pass. For reference, all functional checks are passing — |
DetailsExplanation of ChangeWhen editing private personal details, each field is saved to the The problem: the magic-code page only cleared the draft on the success path. When the user backed out without validating, This adds an unmount cleanup effect on the magic-code page that clears the Fixed Issues$ #92829 Tests
Offline testsSame as Tests QA StepsSame as Tests
PR Author Checklist
@MelvinBot please set the PR body to the content in the details section above |
|
✅ Done — I've set the PR body to the content you provided. |
|
@MelvinBot mark as ready for review |
|
✅ Done — marked this PR as ready for review. |
Reviewer Checklist
Screenshots/VideosAndroid: HybridAppandroid.movAndroid: mWeb ChromeiOS: HybridAppios.moviOS: mWeb SafariMacOS: Chrome / Safariweb.mov |
joekaufmanexpensify
left a comment
There was a problem hiding this comment.
Good for Product
|
🚧 jasperhuangg has triggered a test Expensify/App build. You can view the workflow run here. |
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Deployed to staging by https://github.com/jasperhuangg in version: 9.4.44-0 🚀
|
|
🤖 No help site changes required. This PR is an internal bug fix, not a behavior or feature change. It adds an unmount cleanup effect to The user-facing rule is unchanged: personal-detail edits (Legal Name, Date of Birth, Phone Number, Address) only take effect after the magic code is entered. That is already documented correctly in Account-Settings.md — "Enter the magic code sent to your email or phone to verify the changes." This fix simply makes the app honor that documented behavior when a user backs out without validating. No article describes the pre-fix (buggy) behavior, so nothing needs to be added, corrected, or removed. No draft docs PR was created. @situchan, since no help site changes are required, there is no linked docs PR to review. Let me know if you'd like me to reconsider any specific article. |
|
🚀 Deployed to production by https://github.com/marcaaron in version: 9.4.44-6 🚀
Bundle Size Analysis (Sentry): |
Explanation of Change
When editing private personal details, each field is saved to the
PERSONAL_DETAILS_FORMOnyx draft (inputs useshouldSaveDraft). To preserve the submission payload while the magic-code RHP is open,PrivatePersonalDetailsPageintentionally skips its own unmount-time draft clear when it navigates to the magic-code page, and its comment defers cleanup to the magic-code page's "success path (or the next intentional back out)".The problem: the magic-code page only cleared the draft on the success path. When the user backed out without validating,
onClosejust calledNavigation.goBack()and left the draft intact. On remount, the RHP form re-seeded from that surviving draft, so the unvalidated edit reappeared — while the Profile summary (which reads the committedPRIVATE_PERSONAL_DETAILS, never written optimistically) still showed the old value, causing the divergence in the report.This adds an unmount cleanup effect on the magic-code page that clears the
PERSONAL_DETAILS_FORMdraft whenever the page is left. This covers every exit path — header back arrow, swipe-back, and Android hardware back — and is idempotent with the existing success path (which already clears the draft before navigating away), so validated submissions are unaffected.Fixed Issues
$ #92829
PROPOSAL: #92829 (comment)
Tests
Offline tests
Same as Tests
QA Steps
Same as Tests
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)Avatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.