-
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
[$1000] Web - Request Money: Hmm... it's not here when requesting money after updating a user's profile #26114
Comments
Triggered auto assignment to @lschurr ( |
Bug0 Triage Checklist (Main S/O)
|
Job added to Upwork: https://www.upwork.com/jobs/~0199bcac5d2d2e5bbb |
Current assignee @lschurr is eligible for the External assigner, not assigning anyone new. |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @burczu ( |
Hi @burczu - could you try reproducing this bug? |
This issue is seen by only user A. |
ProposalPlease re-state the problem that we are trying to solve in this issue.The problem is that you can not request money from a user by using the FAB, if you have first created a chat with the user. It has nothing to do with changing settings and can be reproduced by just these simple steps:
What is the root cause of that problem?The problem is caused by a combination of multiple factors. What happens is that the FE is not able to find the existing chat when creating the IOU, assumes that no chat exists between the 2 users and tries to create a new one. The BE is aware of the existing chat and returns the following error: {
...,
jsonCode: 666,
message: "There is a previously existing chat between these users.",
... The way the FE checks if there is an existing chat/report when "Request money" is used from the FAB, is by comparing the account ID of the participant selected with the participants of all of the users existing chats/reports. This happens here: Lines 2820 to 2839 in c20c387
So why is the FE not able the existing chat/report? To explain this, let me first summarize what happens when a new chat is created from the FAB:
App/src/libs/actions/Report.js Lines 491 to 521 in c20c387
Notice how this also pushes an object like the following to {onyxMethod: 'merge',
key: 'personalDetailsList',
value: {
[ACCOUNT_ID]: null
}} The purpose of this is to make sure that the optimistic personal detail is cleared from Onyx once the server responds with the actual personal detail with the correct accountID. However, the above code does not work. It is not possible to clear an object from Onyx by merging it with So, the first step to fixing the issue is to fix this code to properly clear the optimistic personal detail. This doesn't fully solve the problem, however, as there is more to it. The personal detail returned from the BE and stored in Onyx when a new chat is created with a previously unknown participant looks like this: "15542922": {
"accountID": 15542922,
"avatar": "https:\/\/d2k5nsl2zxldvw.cloudfront.net\/images\/avatars\/default-avatar_15.png",
"displayName": "daniel.s.brinkmann+change4@gmail.com",
"firstName": "",
"lastName": "",
"status": null
} If you compare this to the optimistic personal detail from Report.js, you will notice that it has a few extra properties, but more importantly that the This is important because the code responsible for displaying the possible recipients when requesting money from the FAB includes these lines: App/src/libs/OptionsListUtils.js Lines 715 to 719 in c20c387
What changes do you think we should make in order to solve the problem?To solve the problem, we will have to:
I have tested this by manually simulating the BE change and it perfectly resolves the issue. |
Hey @Ischurr! Sorry for the delay - I've missed this one. I'll take a look today! |
ProposalPlease re-state the problem that we are trying to solve in this issue.When we attempt to request money using the "New chat" feature, we encounter the message "Hmm... it's not here when requesting money." To begin with:
What is the root cause of that problem?Final cause for this problem is debtorEmail property is missing (assigned null exactly) in the payload towards API when we request through the New Chat It brings the following response. Therefore, when user confirms requested money, 403 error encountered and shows Hmm... It's not here error. Let me explain why. To begin with:
To perform this operation successfully, we need login property that is associated with this operation. This login porperty is none other than debtorEmail I mentioned above. What changes do you think we should make in order to solve the problem?We have to update these lines as following:
|
@burczu Please check my proposal. |
#26114 (comment) This does not fix the issue. The code you linked is not even executed when requesting money by clicking the FAB, only when doing it from within a report. Like mentioned in my proposal, the cause of the issue is Onyx having multiple personal details stored for the same participant because the optimistic data is not cleared properly upon retrieving the correct data from the BE I wrote in my original proposal that a possible solution could be to remove the filter that requires the login property to be set. However, after further testing, I can now conclude that this is not the way to go, as it will leave "ghost" contacts in the suggestions like this: ![]() I will update my proposal to reflect this. I also forgot to mention in my explanation that a new optimistic personal detail is created here when no existing is found (due to the missing login property). This will have the same, temporary and wrong accountID as the one created when opening the chat report which is why it cannot find the existing chat report to create the IOU within. So to summarize, the solution is to:
If you want to confirm my solution you can:
settledPersonalDetails[accountID] = allPersonalDetails[accountID] || {
login: null,
accountID: null,
avatar: null,
displayName: null,
isOptimisticPersonalDetail: null
}; (for the actual PR this can be done cleaner, this is just for the POC)
Onyx.update([{
onyxMethod: 'merge',
key: 'personalDetailsList',
value: {
12345678: {
login: "example@mail.com"
}
}
}]) (replace "example@mail.com" with the correct email and 12345678 with the account ID returned by the BE in step 2. This can be extracted from the response of the OpenReport request in the network tab or by finding the correct object in Onyx, under the "personalDetailsList"-key). @burczu This can be a confusing issue to wrap your head around, so lmk if you have any questions or need further explanation :-) |
Thank you @dantastisk In that case, we can see the following message from API. I believe that the backend is functioning properly, so now we need to proceed with the redirect operation to the chat channel. |
@binary3oul @dantastisk This report is not about requesting money from an unknown user or having no chat history. If you check the video these two users had a chat history |
Thanks for all the proposals - I'll be reviewing them soon. |
@misgana96 I did some further testing and you are correct. The solution is still the same, however, as the problem is still, that the BE does not set the Because of this the correct personal detail gets filtered out here: App/src/libs/OptionsListUtils.js Lines 715 to 719 in c20c387
|
@lschurr - I've just tested the proposal from @dantastisk and it seem to work. Unfortunately it requires some backend changes so I think we should switch to I've also tested the solution from @binary3oul but it doesn't fix the issue. |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
@lschurr As I wrote in this comment: #26114 (comment) - I think we should wait for @dantastisk to fix the FE part of the issue, as they provided the solution that we originally followed (please see this comment: #26114 (comment)). Maybe we should just assign them? |
Sorry, I have been mia, have been ooo for a couple weeks. I will take a look this week. |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
@dantastisk Any update here? |
Sorry for the delay. I just checked on staging and it seems like BE is still not sending a login property. |
@amyevans are you able to help us with this one? |
Yeah, @amyevans, could you confirm? After your comment: #26114 (comment) you have removed the |
Sorry this wasn't clearer! I haven't done any backend work for this yet, it doesn't feel like it should be prioritized over wave6 work. |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
Should this one still be on hold @amyevans? |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
Probably not HOLD since we don't have any other tracking issue for it. |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
Based on Matt's update, should we be closing this one @amyevans? https://expensify.slack.com/archives/C01SKUP7QR0/p1702341728013009 |
Yeah that makes sense to me, thanks @lschurr! |
I am really curious as to what was in that update. Can you share? |
The update was crossposted here as well - https://expensify.slack.com/archives/C01GTK53T8Q/p1702496349813859 |
Thanks! Does that mean that I get no compensation? Because that would be quite disappointing I must say. |
Yes, unfortunately since we won't be fixing this bug right now, we won't be issuing compensation. It's possible that this will get reopened in the future, at which point you could be hired for the job and compensated once a fix is put in place. Thanks @dantastisk! |
@lschurr What about the reporter bonus? Am I eligiable for a compensation? |
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:
A money request should be sent to user B
Actual Result:
Hmm... it's not here page appears
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.3.57-6
Reproducible in staging?: n/a
Reproducible in production?: n/a
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
Screenshare.-.2023-08-28.8_03_08.PM.mp4
Expensify/Expensify Issue URL:
Issue reported by: @misgana96
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1692440705016829
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: