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 #27168] [$1000] Payments - App crashes when navigating to enable payments page before logging in #26021
What changes do you think we should make in order to solve the problem?
We should add loading check inside our AdditionalDetailsStep to prevent this crash:
// personalDetailsList from ONYXKEYS.PERSONAL_DETAILS_LISTif(!_.isPersonalDetailsReady(personalDetailsList)||_.isEmpty(currentPersonalDetails)){return<FullscreenLoading/>}
Please re-state the problem that we are trying to solve in this issue.
App crashes when navigating to the enable payments page before logging
What is the root cause of that problem?
when login currentUserPersonalDetails having only accountID remaining is not set
Why means after signin it will fetch personaldeatils information from back end and set to onyx and before sign we are trying to reach /enabled-payments page so after signin it will directly render to that page.
before loading currentUserPersonalDetails fully page tries to render const currentUserPersonalDetails = useMemo(() => ({...props.personalDetails[accountID], accountID}), [props.personalDetails, accountID]);
What changes do you think we should make in order to solve the problem?
We should remove accountID here and check the the empty of currentUserPersonalDetails in the additionalDetailsSteps page const currentUserPersonalDetails = useMemo(() => ({...props.personalDetails[accountID], accountID}), [props.personalDetails, accountID]);
we should declare all the props empty in WithCurrentUserPersonalDetails
Or we can declare empty in request param
extractFirstAndLastNameFromAvailableDetails({login, displayName='', firstName='', lastName=''})
The currentUserPersonalDetails is null so it raises error when we call function extractFirstAndLastNameFromAvailableDetails
The root cause is because after login, the OpenApp API is not completed yet, so the personalDetailsList is not ready yet => We couldn't get the currentUserPersonalDetails in this line, so it will be null:
What changes do you think we should make in order to solve the problem?
In the EnablePaymentsPage component, we should check if the Onyx key ONYXKEYS.IS_LOADING_REPORT_DATA is true, we should display loading page in this line
changed the title [-]Payments - App crashes when navigating to enable payments page before logging in[/-][+][$1000] Payments - App crashes when navigating to enable payments page before logging in[/+]on Aug 28, 2023
changed the title [-][$1000] Payments - App crashes when navigating to enable payments page before logging in[/-][+][Hold for #27168] [$1000] Payments - App crashes when navigating to enable payments page before logging in[/+]on Sep 20, 2023
P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!
It's a delicate topic, but there probably will be no payment. Unless it's a very special case (which this one isn't), payments are done for merged PRs. I'm sorry about this, but this is one of the inherent risks associated with our process.
Activity
melvin-bot commentedon Aug 27, 2023
Triggered auto assignment to @NicMendonca (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.melvin-bot commentedon Aug 27, 2023
Bug0 Triage Checklist (Main S/O)
Platformsin OP are ✅)hungvu193 commentedon Aug 27, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
Payments - App crashes when navigating to enable payments page before logging in
What is the root cause of that problem?
Problem came from this function when we tried to get the
indexOffrom undefined value.App/src/pages/EnablePayments/AdditionalDetailsStep.js
Line 192 in c169952
App/src/libs/actions/PersonalDetails.js
Line 100 in c169952
What changes do you think we should make in order to solve the problem?
We should add loading check inside our
AdditionalDetailsStepto prevent this crash:Also adding a defaultValue for
displayNameas empty string insideextractFirstAndLastNameFromAvailableDetailsfunction.Other screens that used the
currentPersonalDetailscan also face this issue, we can apply this fix for those screens too.What alternative solutions did you explore? (Optional)
N/A
pradeepmdk commentedon Aug 27, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
App crashes when navigating to the enable payments page before logging
What is the root cause of that problem?
when login currentUserPersonalDetails having only accountID remaining is not set
Why means after signin it will fetch personaldeatils information from back end and set to onyx and before sign we are trying to reach /enabled-payments page so after signin it will directly render to that page.
before loading
currentUserPersonalDetailsfully page tries to renderconst currentUserPersonalDetails = useMemo(() => ({...props.personalDetails[accountID], accountID}), [props.personalDetails, accountID]);What changes do you think we should make in order to solve the problem?
accountIDhere and check the the empty ofcurrentUserPersonalDetailsin theadditionalDetailsStepspageconst currentUserPersonalDetails = useMemo(() => ({...props.personalDetails[accountID], accountID}), [props.personalDetails, accountID]);WithCurrentUserPersonalDetailsOr we can declare empty in request param
extractFirstAndLastNameFromAvailableDetails({login, displayName='', firstName='', lastName=''})
hoangzinh commentedon Aug 27, 2023
Proposal
Please re-state the problem that we are trying to solve in this issue.
Payments - App crashes when navigating to enable payments page before logging in
What is the root cause of that problem?
App/src/pages/EnablePayments/AdditionalDetailsStep.js
Line 192 in c029dc5
The
currentUserPersonalDetailsis null so it raises error when we call functionextractFirstAndLastNameFromAvailableDetailsOpenAppAPI is not completed yet, so thepersonalDetailsListis not ready yet => We couldn't get thecurrentUserPersonalDetailsin this line, so it will be null:App/src/components/withCurrentUserPersonalDetails.js
Line 39 in c029dc5
What changes do you think we should make in order to solve the problem?
In the
EnablePaymentsPagecomponent, we should check if the Onyx keyONYXKEYS.IS_LOADING_REPORT_DATAis true, we should display loading page in this lineApp/src/pages/EnablePayments/EnablePaymentsPage.js
Lines 53 to 55 in c029dc5
So it only renders child components whenever the
OpenAppdata is ready.[-]Payments - App crashes when navigating to enable payments page before logging in[/-][+][$1000] Payments - App crashes when navigating to enable payments page before logging in[/+]melvin-bot commentedon Aug 28, 2023
Job added to Upwork: https://www.upwork.com/jobs/~0185374146bc15359c
melvin-bot commentedon Aug 28, 2023
Current assignee @NicMendonca is eligible for the External assigner, not assigning anyone new.
melvin-bot commentedon Aug 28, 2023
Triggered auto assignment to Contributor-plus team member for initial proposal review - @cubuspl42 (
External)28 remaining items
[-][$1000] Payments - App crashes when navigating to enable payments page before logging in[/-][+][Hold for #27168] [$1000] Payments - App crashes when navigating to enable payments page before logging in[/+]melvin-bot commentedon Oct 9, 2023
This issue has not been updated in over 15 days. @robertjchen, @cubuspl42, @hoangzinh, @NicMendonca eroding to Monthly issue.
P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!
jakub-trzebiatowski commentedon Oct 9, 2023
Still on hold
robertjchen commentedon Nov 6, 2023
still on hold
hoangzinh commentedon Nov 30, 2023
@cubuspl42 @robertjchen it looks like it's fixed somewhere. I couldn't reproduce this issue in the latest main.
Screen.Recording.2023-11-30.at.23.57.10.mov
jakub-trzebiatowski commentedon Dec 1, 2023
Conclusion: if you hold for long enough, the issue fixes itself 😅
hoangzinh commentedon Dec 4, 2023
So I think the next step should be payment, and then closing this issue 🤔
jakub-trzebiatowski commentedon Dec 4, 2023
It's a delicate topic, but there probably will be no payment. Unless it's a very special case (which this one isn't), payments are done for merged PRs. I'm sorry about this, but this is one of the inherent risks associated with our process.
hoangzinh commentedon Dec 4, 2023
Ah @cubuspl42 fyi, this case is the same as step 19. in Updated process section of https://docs.google.com/document/d/1BvohU05MTaHnjOD_vwJv_aqDAirv-ChkyRnKCAvOVyQ
hoangzinh commentedon Jan 2, 2024
cc @NicMendonca can you help process payment here then we can close this issue? ^ Thanks
jakub-trzebiatowski commentedon Jan 3, 2024
It seems you're right
NicMendonca commentedon Jan 9, 2024
everyone's been paid!