Closed kbecciv closed 1 year ago
:wave: 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:
Triggered auto assignment to @MariaHCD (Engineering
), see https://stackoverflow.com/c/expensify/questions/4319 for more details.
Merchant cannot be empty thats backend restriction, we probably need to add a validation here
Not validating the merchant field to be required(not reproducing crash on the dev env)
We don't have any validation to restrict empty value for the merchant.
Reason for a crash: When we refresh the money request report we receive incorrect structure by ReconnectApi call for reportActions
which leads to the transaction undefined and accessing fields of undefined crashes the app.
Add validate
function and pass it to the the Form
by setting the merchant
as a required field.
const validate = (values) => {
const requiredFields = ['merchant'];
const errors = ValidationUtils.getFieldRequiredErrors(values, requiredFields);
return errors;
}
Same needs to be done for MoneyRequestMerchantPage
component by using the field name moneyRequestMerchant
.
Provide the default value in the lodashGet pendingFields.fieldname
for pendingAction
prop which we are passing to OfflineWithFeedback
in the MoneyRequestView
component. 1, 2, 3, 4
cc: @koko57 Please let us know what you find, thanks!
⚠️ Looks like this issue was linked to a Deploy Blocker here
If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.
If a regression has occurred and you are the assigned CM follow the instructions here.
If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.
@MariaHCD I couldn't reproduce it locally, I managed to reproduce it on staging so it's hard for me to tell for now what the exact RC is. I think that if we don't want to change the merchant to the empty string, the solution @Pujan92 proposes should work here
I am able to reproduce the crash locally also due to incorrect orders bcoz whenever we refresh the money request report we won't get pendingFields
in the api onyx response which causes the issue(accessing undefined of pendingFields).
That makes sense, thanks @Pujan92.
One thing about your proposal:
Reason for a crash might be: Conditions are in the wrong order for all the fields here. First, we need to check for pendingAction availability in the transaction and then check for specific child fields.
Do you mean we first need to check for pendingFields
in the transaction
before trying to fetch any child fields?
Yes @MariaHCD
Sorry, I made a mistake in thinking. We need to provide a default value for specific pendingFields considering the above reason bcoz we need to greyed out in any condition. I will update my proposal.
- {lodashGet(transaction, 'pendingFields.amount') || lodashGet(transaction, 'pendingAction')}
+ {lodashGet(transaction, 'pendingFields.amount', null) || lodashGet(transaction, 'pendingAction')}
Okay, I was finally able to reproduce the issue on staging and saw the console error:
https://github.com/Expensify/App/assets/12268372/b3a17751-4e2f-4021-b619-4ba36c63998b
Something fishy seems to be here, after a moment transactionID
becomes 0(on refresh the report)
@koko57 looks like same https://github.com/Expensify/App/issues/26204
I think reconnetApp api returns reportActions in the wrong structure. Needs to be an object but receiving array.
That leads allReportActions
to contain some incorrect structure entries which cause the transactionID
to be 0. With that required transaction
will be undefined and we try to access props on it which eventually crashes the app.
@MariaHCD @koko57 I think we do need to correct the structure in the BE for ReconnectApp
api.
I can not reproduce this issue on the main. I also think that merchant is removable otherwise why would we show removed?
@parasharrajat I could reproduce it locally on main when I switched to using staging server
and yeah, I agree with @Pujan92 that it should be checked on the BE as it happens not only for removing the merchant but also when editing other fields
I can not reproduce this issue on the main. I also think that merchant is removable otherwise why would we show removed?
Even if we try to Save by clearing the input, it passes the previousValue(not the empty value) and returns some error message in response(Call to a member function getDisplayInformation() on null
).
https://github.com/Expensify/App/blob/4675db5348e305daca320f91066476344191d8d2/src/libs/TransactionUtils.js#L211-L213
I think we are showing based on the optimistic onyx data.
https://github.com/Expensify/App/assets/14358475/ad1f638d-92cd-418b-8b9f-f62904410b21
I think reconnetApp api returns reportActions in the wrong structure. Needs to be an object but receiving array.
👀 Interesting, looking if something changed on the backend.
From this other deploy blocker: https://github.com/Expensify/App/issues/26204
We're reverting this PR: https://github.com/Expensify/App/pull/25675
Regarding the format of the report actions, I am checking this internal PR: https://github.com/Expensify/Web-Expensify/pull/38626
⚠️ Looks like this issue was linked to a Deploy Blocker here
If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.
If a regression has occurred and you are the assigned CM follow the instructions here.
If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.
⚠️ Looks like this issue was linked to a Deploy Blocker here
If you are the assigned CME please investigate whether the linked PR caused a regression and leave a comment with the results.
If a regression has occurred and you are the assigned CM follow the instructions here.
If this regression could have been avoided please consider also proposing a recommendation to the PR checklist so that we can avoid it in the future.
@MariaHCD let me know if I need to work on the validation part that is mentioned here as saving empty merchant isn't working correctly.
Fix here - https://github.com/Expensify/Web-Expensify/pull/38665. This is not an App blocker, so gonna remove the label.
Resolved on staging with a web-E CP. Closing issue. If it persists feel free to reopen.
@chiragsalian aren't we supposed to fix the validation part of the merchant here?
@chiragsalian I can not repro the issue in the latest build. Reverting this https://github.com/Expensify/App/pull/25675 might have resolved the issue.
Am I eligible for reporting bones?
@mountiny to confirm, do we need to add the required validations for the merchant field here?
Triggered auto assignment to @trjExpensify (Bug
), see https://stackoverflow.com/c/expensify/questions/14418 for more details.
Platforms
in OP are ✅)@daveSeife Yes
$250
@mountiny Okay. Thank you!
Created a PR which will not allow empty merchants
Cool, so confirming after that PR is merged we'll pay the reporting bonus of $250 for this issue only?
@trjExpensify I think we can already pay out the reporting bonus $250, the crash is fixed now
Okay, perfect. @daveSeife I've sent you an offer.
@trjExpensify Accepted the offer. Thank You!
Perfect, paid!
Reviewing
label has been removed, please complete the "BugZero Checklist".
The solution for this issue has been :rocket: deployed to production :rocket: in version 1.3.61-3 and is now subject to a 7-day regression period :calendar:. Here is the list of pull requests that resolve this issue:
If no regressions arise, payment will be issued on 2023-09-08. :confetti_ball:
After the hold period is over and BZ checklist items are completed, please complete any of the applicable payments for this issue, and check them off once done.
For reference, here are some details about the assignees on this issue:
As a reminder, here are the bonuses/penalties that should be applied for any External issue:
BugZero Checklist: The PR fixing this issue has been merged! The following checklist (instructions) will need to be completed before the issue can be closed:
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Action Performed:
Expected Result:
The app does not crash
Actual Result:
App crashes
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.3.58.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 Notes/Photos/Videos: Any additional supporting documentation
https://github.com/Expensify/App/assets/93399543/f99358ed-8157-4dc3-a36b-e28a8597bbff
https://github.com/Expensify/App/assets/93399543/8e18e9c3-6be8-494f-aa5f-fea7cabea6d1
Expensify/Expensify Issue URL: Issue reported by: @daveSeife Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1693277798912359
View all open jobs on GitHub