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
[HOLD for payment 2024-01-11] [$250] IOU - System message for merchant edit shows up for each time empty merchant is saved #33780
Version Number: 1.4.20-0 Reproducible in staging?: Y Reproducible in production?: N 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: Applause - Internal Team Slack conversation:
Action Performed:
Create a manual request with no merchant as IOU report (between two users)
Go to request details page
Click Merchant
Without entering value, save it
Expected Result:
No system message for merchant edit will appear because there is no change in Merchant
Actual Result:
Each time the empty merchant is saved, the system message for merchant edit will show up - changed the merchant to "(none)" (previously "(none)"
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
👋 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.
The system message for merchant edit shows up each time an empty merchant is saved
What is the root cause of that problem?
in the onSubmit function we check if the old merchant value equals the new merchant value then the modal should be dismissed, however in our case this condition fails because the old merchant value is (none) and the new value when saving without change is `` (empty string)
we can also refactor the onSubmit function to be like this:
onSubmit={(transactionChanges)=>{constnewTrimmedMerchant=transactionChanges.merchant.trim();constisOldMerchantEmpty=transactionMerchant===CONST.TRANSACTION.PARTIAL_TRANSACTION_MERCHANT;constisNewMerchantEmpty=newTrimmedMerchant==='';// Check if merchant is unchanged or if new merchant is empty for an empty old merchantconstisMerchantUnchanged=newTrimmedMerchant===transactionMerchant||(isNewMerchantEmpty&&isOldMerchantEmpty);// Dismiss modal if merchant hasn't changedif(isMerchantUnchanged){Navigation.dismissModal();return;}// Handle IOU requests for empty new merchantif(isNewMerchantEmpty){editMoneyRequest({merchant: CONST.TRANSACTION.PARTIAL_TRANSACTION_MERCHANT});return;}// Update the merchant for other caseseditMoneyRequest({merchant: newTrimmedMerchant});}}
@abzokhattab Do you fancy being C+ on the PR for $250? I will put up the fix and you will do testing and review? Its a simple PR but the authors are out
Activity
github-actions commentedon Dec 29, 2023
👋 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:
melvin-bot commentedon Dec 29, 2023
Triggered auto assignment to @Beamanator (
Engineering), see https://stackoverflow.com/c/expensify/questions/4319 for more details.abzokhattab commentedon Dec 29, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
The system message for merchant edit shows up each time an empty merchant is saved
What is the root cause of that problem?
in the onSubmit function we check if the old merchant value equals the new merchant value then the modal should be dismissed, however in our case this condition fails because the old merchant value is
(none)and the new value when saving without change is `` (empty string)App/src/pages/EditRequestPage.js
Lines 197 to 201 in f1a4621
What changes do you think we should make in order to solve the problem?
We need to consider this corner case and dismiss the modal without calling the backend:
we can also refactor the onSubmit function to be like this:
mountiny commentedon Dec 29, 2023
@waterim @koko57 this is one usecase we have missed in the PR
mountiny commentedon Dec 29, 2023
@abzokhattab Do you fancy being C+ on the PR for $250? I will put up the fix and you will do testing and review? Its a simple PR but the authors are out
abzokhattab commentedon Dec 29, 2023
@mountiny sure!
35 remaining items
melvin-bot commentedon Jan 5, 2024
Triggered auto assignment to @garrettmknight (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.mountiny commentedon Jan 5, 2024
$250 to @abzokhattab for help with review and testing the PR
garrettmknight commentedon Jan 8, 2024
Will update payment on 1/11
garrettmknight commentedon Jan 11, 2024
Paid!