-
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
[HOLD for payment 2024-12-07] [HOLD for payment 2024-12-05] iOS - Expense - Tapping Save button (from Merchant page) for the second time returns to BNP #53152
Comments
Triggered auto assignment to @strepanier03 ( |
Triggered auto assignment to @marcaaron ( |
💬 A slack conversation has been started in #expensify-open-source |
👋 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:
|
Edited by proposal-police: This proposal was edited at 2024-11-26 19:31:15 UTC. ProposalPlease re-state the problem that we are trying to solve in this issue.iOS - Expense - Tapping Save button (from Merchant page) for the second time returns to BNP What is the root cause of that problem?When clicking save button twice, function call for Prior to this addition, when hitting submit button it used to execute App/src/components/Form/FormProvider.tsx Line 210 in c4ff235
But now it is possible to click submit button for the second time until KeyboardUtils.dismiss().then(() => onSubmit(trimmedStringValues)); is executed and hence formstate.isLoading is still false and hence no early return.
What changes do you think we should make in order to solve the problem?Now we can include a new local state to to hold information about submission state. const [isSubmitting, setIsSubmitting] = useState(false);
const submit = useCallback(() => {
// Return early if the form is already submitting to avoid duplicate submission
if (formState?.isLoading || isSubmitting) {
return;
}
// Prepare values before submitting
const trimmedStringValues = shouldTrimValues ? ValidationUtils.prepareValues(inputValues) : inputValues;
// Touches all form inputs, so we can validate the entire form
Object.keys(inputRefs.current).forEach((inputID) => (touchedInputs.current[inputID] = true));
// Validate form and return early if any errors are found
if (!isEmptyObject(onValidate(trimmedStringValues))) {
return;
}
// Do not submit form if network is offline and the form is not enabled when offline
if (network?.isOffline && !enabledWhenOffline) {
return;
}
setIsSubmitting(true);
KeyboardUtils.dismiss().then(() => onSubmit(trimmedStringValues));
}, [enabledWhenOffline, formState?.isLoading, inputValues, network?.isOffline, onSubmit, onValidate, shouldTrimValues,isSubmitting]); App/src/components/Form/FormProvider.tsx Lines 188 to 211 in c4ff235
What alternative solutions did you explore? (Optional)Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job. |
@ChavdaSachin can you please point what PR caused this regression from the checklist? |
Yes, I appreciate the investigation. But I am unsure about this proposal and would like to understand the root cause. |
My guess would be this PR #52392 |
Specifically this stuff: Maybe the handler is slow or something. But it's pretty much a guess. |
@kirillzyusko @c3024 could you please investigate this flow for a fix? this is in standalone app too so you should be able to test |
Yes this is coming from #52392. |
Updated Proposal @marcaaron could you take a look at my updated proposal, I could raise a quick fix. ResultScreen.Recording.2024-11-27.at.3.15.01.AM.mov |
Yes, let's give some time to @kirillzyusko first since it is a regression. |
I agree with proposal from @ChavdaSachin Two things that I would do differently:
@ChavdaSachin will you fix this problem? Or should I fix it because it was my changes that introduced a regression? |
I would be happy to fix this |
@ChavdaSachin then I'm happy to approve your proposal. Is there anything else required from my side? |
As of now it's pretty straightforward, but I will let you know if I face any further complications. |
I have got it working |
just testing on all the platforms |
@ChavdaSachin Nice, please feel free to make a draft |
@IuliiaHerets I also discovered that a problem with double navigations happens on:
|
CPing the fix, thanks @kirillzyusko |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.67-9 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 2024-12-05. 🎊 For reference, here are some details about the assignees on this issue:
|
@c3024 @strepanier03 @c3024 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] |
The solution for this issue has been 🚀 deployed to production 🚀 in version 9.0.68-7 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 2024-12-07. 🎊 For reference, here are some details about the assignees on this issue:
|
@c3024 @strepanier03 @c3024 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] |
This is confirmed as fixed @c3024 can you pelase complete the checklist? |
BugZero Checklist:
Bug classificationSource of bug:
Where bug was reported:
Who reported the bug:
Regression Test Proposal Template
Regression Test ProposalPrecondition:Test:
Do we agree 👍 or 👎 |
I dont think we need to add a regression test specifically for this, the QA will most likely catch some bug in normal testing |
Given this came from a PR @c3024 reviewed and the author fixed it, I think we can just close it, thanks! |
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Version Number: 9.0.67-0
Reproducible in staging?: Y
Reproducible in production?: N
If this was caught on HybridApp, is this reproducible on New Expensify Standalone?: Y
Email or phone of affected tester (no customers): [email protected]
Issue reported by: Applause Internal Team
Action Performed:
Expected Result:
Actual Result:
Workaround:
Unknown
Platforms:
Screenshots/Videos
Bug6677216_1732642719040.ScreenRecording_11-27-2024_01-34-51_1.mp4
View all open jobs on GitHub
Issue Owner
Current Issue Owner: @strepanier03The text was updated successfully, but these errors were encountered: