-
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 2023-10-16] [$500] Web - Adding extra number to Share Code, it throws error ' Auth GetEmailByAccountID returned an error" #27381
Comments
Triggered auto assignment to @maddylewis ( |
Job added to Upwork: https://www.upwork.com/jobs/~0143309d373d417e8b |
Bug0 Triage Checklist (Main S/O)
|
Triggered auto assignment to @lschurr ( |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @burczu ( |
Please re-state the problem that we are trying to solve in this issue.Attempting to access a non-existent user's profile by using the share link throws an error without redirecting to a 404 page. What is the root cause of that problem?The code processing the API's response does not have a handler for redirecting to a 404 page. Line 110 in 56271f0 The profile data for a given user is requested in a useEffect call on line 103 Line 103 in 56271f0
This is loaded into state in the openPublicProfilePage method in actions/PersonalDetails.js https://github.com/Expensify/App/blob/56271f0b1a60a2ea17b418b458648bbdf4fde483/src/libs/actions/PersonalDetails.js and subsequently is available in the props of ProfilePage as props.personalDetails. There is no check to see if the state update from the action has returned a failed result or a successful result. What changes do you think we should make in order to solve the problem?Since visiting a non-existent user's profile should logically be treated as a 404 error, my solution is to check the value of props.personalDetails, and then use Navigation.navigate(SCREENS.NOT_FOUND) to redirect the user to the 404 page if the result is not a valid PersonalDetails object. Similar to how the isTaskReport function checks if props.report is a valid report and then exits the modal if the report is not valid in TaskDescriptionPage, I'd redirect to SCREENS.NOT_FOUND (or just exit the page like in the TaskDescriptionPage if that seems more appropriate) if props.personalDetails was not a valid PersonalDetails object. (https://github.com/Expensify/App/blob/56271f0b1a60a2ea17b418b458648bbdf4fde483/src/pages/tasks/TaskDescriptionPage.js) What alternative solutions did you explore? (Optional) |
📣 @graylewis! 📣
|
Contributor details |
✅ Contributor details stored successfully. Thank you for contributing to Expensify! |
ProposalPlease re-state the problem that we are trying to solve in this issue.Opening a non-existing user profile directly through the URL throws error ' Auth GetEmailByAccountID returned an error" What is the root cause of that problem?The higher order function App/src/libs/actions/OnyxUpdates.js Lines 35 to 41 in c9580da
Since as per the current issue, the profile does not exist, hence the error code that is returned is 404 ( See Attached ) Hence, the error returns 404 which is not handled. The message also says "Email not found." What changes do you think we should make in order to solve the problem?We can add another if block in the App/src/libs/actions/OnyxUpdates.js Lines 32 to 42 in c9580da
Attached is the video POC expensify-bug-fix-1.movWhat alternative solutions did you explore? (Optional)None |
I think this is a BE bug, we should return the avatar as null if the accountID doesn't exist. |
Current assignee @burczu is eligible for the Internal assigner, not assigning anyone new. |
No, because backend is returning 404 which is fine. |
Current assignee @maddylewis is eligible for the External assigner, not assigning anyone new. |
Current assignee @burczu is eligible for the External assigner, not assigning anyone new. |
@burczu - will you help me confirm whether or not this recent bug report will be fixed with whichever solution we move forward with for |
@maddylewis I don't think so - in this issue we change the ID that is in the URL address that causes error on the backend side - it can't find this ID in database. In the bug report you've mentioned we add double slash to the URL (URLs with double slashes are in general still correct, that's why the App works correctly with it), and perhaps, we need to add some mechanism to remove it while navigating to other pages. |
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. |
|
The solution for this issue has been 🚀 deployed to production 🚀 in version 1.3.79-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-10-16. 🎊 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:
|
@jasperhuangg and what would the front-end show? |
@graylewis can you look into the deploy blocker and see what was missed? |
@madmax330 yeah definitely, I'll take a look now |
@madmax330 Alright, after looking into it it seems that public profiles are treated the same as a 404 on the backend. When I try to open my account using my share code from a brand new account and message myself, I get the "Auth GetEmailByAccountId returned an error" message from the original report. As I mention in my PR, the backend doesn't return a 404 for non-existent profiles. This is the primary issue, and my solution is a workaround to throw a 404 appropriately in the meantime. The patch I implemented should work given that a user's display name should be defined for existent profiles and undefined for non-existent profiles (when I looked into it, this seemed to be true). Unfortunately, it seems that the backend isn't returning any info for existent profiles that I don't already have in my contacts. This is the data returned from the backend for my share link: (note that displayName is undefined)
This is identical to the data received when using a non-existent share code. I'm not sure if this is intended behavior (it feels wrong to me), but either way the fact that "Auth GetEmailByAccountId returned an error" is thrown even for valid share codes seems to indicate a deeper issue. Reproduction steps:
EDIT: |
Because staging and production run two separate backend versions. So maybe the issue is fixed now? |
based on the status of this issue, does it make sense for @burczu to go through this checklist? #27381 (comment) |
@madmax330, @burczu, @graylewis, @maddylewis Whoops! This issue is 2 days overdue. Let's get this updated quick! |
No since the changes were reverted I don't think it makes sense |
Leaving a note here for myself on where we are with this one:
to clarify, are we waiting for @graylewis to share a new proposal for this same issue since the original changes were reverted? |
Since there's no straightforward solution for this. I'm wondering if we should just close this. While I get the issue, I think that if you tamper with the url and the app throws an error I think that's fine, we could handle it better, but not really worth the effort IMO. There's no reason you should be tampering with the url anyways. |
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Action Performed:
e.g : shareCode profile URL + '1' or shareCode profile URL + '5'
Expected Result:
Since the proflies are enumerated cronologically, for profile URLs that doesn't exits. ' Hmm,, not there ' or something equivalent must be shown.
Actual Result:
Adding extra number to Share Code, it throws error ' Auth GetEmailByAccountID returned an error"
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.3.69.0
Reproducible in staging?: y
Reproducible in production?: y
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
Screen.Recording.2023-09-11.at.3.17.07.PM.mov
Recording.4448.mp4
Expensify/Expensify Issue URL:
Issue reported by: @ashimsharma10
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1694426884818349
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: