-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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 2023-08-08] [$1000] Dev: Web - App crashes when trying to unlink secondary contact method #22934
Comments
Triggered auto assignment to @sonialiap ( |
Bug0 Triage Checklist (Main S/O)
|
ProposalPlease re-state the problem that we are trying to solve in this issue.In the current Expensify app, attempting to unlink a secondary contact method leads to an application crash. This unexpected behaviour is triggered under the condition that the secondary contact method is unverified. This issue is particularly associated with the process of secondary contact validation and de-linking. What is the root cause of that problem?Investigation points to the translate function, which is used to handle language-specific translations of phrase keys in the application. It appears that when this function doesn't find a phrase key in the language dictionaries, it throws an error that leads to the application crash. What changes do you think we should make in order to solve the problem?A more robust alternative is to utilize the translateIfPhraseKey function which, unlike translate, returns the original message when a matching phrase is not found, rather than throwing an error. This graceful degradation prevents the application from crashing due to an error thrown. Moreover, the translateIfPhraseKey function seems specifically designed for situations where the phrase keys might be dynamic or potentially non-existent in the language dictionaries, thus making it a more resilient choice. Therefore, by replacing the translate function with translateIfPhraseKey in the specific code path related to unlinking secondary contact methods, we can avoid this issue and improve the overall robustness of the application. What alternative solutions did you explore? (Optional)Alternatively, like others, if the message is pre-translated, we could directly display the message as received. This approach bypasses the application of the translate or translateIfPhraseKey functions for this scenario, streamlining the process and diminishing the possibility of an application crash. Result: Studio_Project_V1.mp4 |
ProposalPlease re-state the problem that we are trying to solve in this issue.App crashes when trying to unlink secondary contact method. What is the root cause of that problem?If unlink secondary contact method, App/src/libs/actions/Session/index.js Lines 763 to 770 in ca8d279
After unlink success, App/src/pages/signin/UnlinkLoginForm.js Lines 65 to 72 in ca8d279
Since What changes do you think we should make in order to solve the problem?We should store message key to {
onyxMethod: Onyx.METHOD.MERGE,
key: ONYXKEYS.ACCOUNT,
value: {
isLoading: false,
- message: Localize.translateLocal('unlinkLoginForm.succesfullyUnlinkedLogin'),
+ message: 'unlinkLoginForm.succesfullyUnlinkedLogin',
},
}, What alternative solutions did you explore? (Optional)None. |
Didn't get to triaging this bug, I'll take a look at it tomorrow! |
The app isn't crashing for me but I'm not receiving the magic link after step 5 🐛 |
Job added to Upwork: https://www.upwork.com/jobs/~0125c02caca7cbee50 |
Current assignee @sonialiap is eligible for the External assigner, not assigning anyone new. |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @mollfpr ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.Web - App crashes when trying to unlink secondary contact method What is the root cause of that problem?In the App/src/libs/actions/Session/index.js Line 635 in cd851d0
![]() What changes do you think we should make in order to solve the problem?Instead of passing the translated value, pass the
This is the standard we are following in the entire application. Check the below code App/src/libs/actions/Session/index.js Line 599 in cd851d0
Result : f29ce87d-8a66-45b0-bf6f-de56cdad3816.mp4What alternative solutions did you explore? (Optional)None |
Thank you guys for the proposals! I agree we should store localized messages in the Onyx with the phrase key instead the translated message. So the user will have the correct message shown based on their selected language. The proposal from @StevenKKC looks good to me. 🎀 👀 🎀 C+ reviewed! |
Triggered auto assignment to @MonilBhavsar, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
Looks good 👍 |
📣 @mollfpr 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app! |
📣 @StevenKKC 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app! Offer link |
📣 @Natnael-Guchima 🎉 An offer has been automatically sent to your Upwork account for the Reporter role 🎉 Thanks for contributing to the Expensify app! |
Accepted the offer. Thanks👍 |
Based on my calculations, the pull request did not get merged within 3 working days of assignment. Please, check out my computations here:
On to the next one 🚀 |
The C+ approval is on Jul 26, so this is still eligible for the bonus. |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.48-5 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 2023-08-08. 🎊 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:
|
https://github.com/Expensify/App/pull/15811/files#r1286197062
We have a checklist to ensure the copy/text is localized correctly in the reviewer checklist. So regression step should be enough.
(Web only)
|
@Natnael-Guchima report $250 - paid ✔️ |
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:
App shouldn't crash & should unlink the secondary contact method
Actual Result:
App crashes
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.3.40-5
Reproducible in staging?: n
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
Screencast.from.2023-07-14.15-40-28.mp4
Expensify/Expensify Issue URL:
Issue reported by: @Natnael-Guchima
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1689338260193289
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: