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
[$500] [HOLD for payment 2023-09-06] Dev - Unable to select a state #25998
Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2EngineeringExternalAdded to denote the issue can be worked on by a contributorHelp WantedApply this label when an issue is open to proposals by contributorsNeeds ReproductionReproducible steps needed
Can the user still use Expensify without this being fixed? Have you informed them of the workaround?
Platforms:
Which of our officially supported platforms is this issue occurring on?
Android / native
Android / Chrome
iOS / native
iOS / Safari
MacOS / Chrome / Safari
MacOS / Desktop
Version Number: Reproducible in staging?: dev Reproducible in production?: dev 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 Notes/Photos/Videos: Any additional supporting documentation
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open StagingDeployCash deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
Identify the pull request that introduced this issue and revert it.
Please re-state the problem that we are trying to solve in this issue.
On typing any char for statepicker the modal gets hide
What is the root cause of that problem?
Seems regression from #25672 where we migrate the BaseModal class component to the function component. Currently, it is doing the cleanup on the dependency changes which should occur on unmounting.
Reason: Whenever user types in the state textinput, StatePicker will gets rerender and it creates new ref to the hidePickerModal as we haven't used useCallback for it. With this, useEffect dep change triggers and it will call the clean up function which will hide the modal.
Same can be reproducible for CountryPicker in Profile -> Home Address.
useEffect(() => {
return () => {
// Only trigger onClose and setModalVisibility if the modal is unmounting while visible.
if (isVisible) {
hideModal(true);
Modal.willAlertModalBecomeVisible(false);
}
// To prevent closing any modal already unmounted when this modal still remains as visible state
Modal.setCloseModal(null);
};
}, []);
Considering the other issue https://expensify.slack.com/archives/C049HHMV9SM/p1693115903343099 or similar issues where subsequent modal isn't opening, we need to add dependency onModalHide here as the function needs to update the ref when onModalHide updates, otherwise it calls the old onModalHide function and create issues. Bcoz for ThreeDotsMenu and FloatingActionButtonAndPopover we don't use shouldSetModalVisibility which won't recreate the func hideModal in BaseModal component.
Awaiting PaymentAuto-added when associated PR is deployed to productionBugSomething is broken. Auto assigns a BugZero manager.DailyKSv2EngineeringExternalAdded to denote the issue can be worked on by a contributorHelp WantedApply this label when an issue is open to proposals by contributorsNeeds ReproductionReproducible steps needed
Activity
melvin-bot commentedon Aug 26, 2023
Triggered auto assignment to @kevinksullivan (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.melvin-bot commentedon Aug 26, 2023
Bug0 Triage Checklist (Main S/O)
Platformsin OP are ✅)OSBotify commentedon Aug 26, 2023
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open
StagingDeployCashdeploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:melvin-bot commentedon Aug 26, 2023
Triggered auto assignment to @tylerkaraszewski (
Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.Pujan92 commentedon Aug 26, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
On typing any char for statepicker the modal gets hide
What is the root cause of that problem?
Seems regression from #25672 where we migrate the
BaseModalclass component to the function component. Currently, it is doing the cleanup on the dependency changes which should occur on unmounting.App/src/components/Modal/BaseModal.js
Lines 84 to 94 in c169952
https://github.com/Expensify/App/pull/25672/files#diff-a766f362da94923822313f0249c8cfaedf93151a08220f529255c40fc67bbf55L54-L63
Reason: Whenever user types in the state textinput,
StatePickerwill gets rerender and it creates new ref to thehidePickerModalas we haven't useduseCallbackfor it. With this,useEffectdep change triggers and it will call the clean up function which will hide the modal.Same can be reproducible for
CountryPickerin Profile -> Home Address.App/src/components/StatePicker/index.js
Line 52 in c169952
What changes do you think we should make in order to solve the problem?
I think we need to add a new
useEffectwithout any dependency and move this clean up there which acts like acomponentWillUnmount.App/src/components/Modal/BaseModal.js
Line 95 in c169952
onModalHidehere as the function needs to update the ref whenonModalHideupdates, otherwise it calls the oldonModalHidefunction and create issues. Bcoz forThreeDotsMenuandFloatingActionButtonAndPopoverwe don't useshouldSetModalVisibilitywhich won't recreate the funchideModalinBaseModalcomponent.App/src/components/Modal/BaseModal.js
Lines 67 to 75 in c029dc5
[shouldSetModalVisibility, onModalHide]Result
Screen.Recording.2023-08-27.at.01.27.50.mov
51 remaining items
kevinksullivan commentedon Sep 15, 2023
Payment summary:
allroundexperts commentedon Sep 15, 2023
Is there any speed bonus here @kevinksullivan?
allroundexperts commentedon Sep 17, 2023
Checklist
allroundexperts commentedon Sep 17, 2023
Bump of #25998 (comment) @kevinksullivan!
kevinksullivan commentedon Sep 21, 2023
Sorry @allroundexperts I missed that. Updated payment amounts
kevinksullivan commentedon Sep 21, 2023
Updated payment to @Pujan92 , just need to pay out @allroundexperts
hayata-suenaga commentedon Sep 25, 2023
@allroundexperts could you accept the offer?
kevinksullivan commentedon Sep 27, 2023
Asking @JmillsExpensify in DM about the newdot payment.
JmillsExpensify commentedon Oct 5, 2023
$1,500 payment approved for @allroundexperts based on BZ summary.