-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[$250] Task – Task creator avatar appears briefly on top of chat when create task with non-existing #47151
Comments
Triggered auto assignment to @bfitzexpensify ( |
We think this issue might be related to the #vip-vsb |
Minor bug. Will send external to see if it's easy to resolve, but I think this is the type of thing we could also close. |
Job added to Upwork: https://www.upwork.com/jobs/~016ea999111b3bbb3c |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @c3024 ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.When assigning a task to a non-existent user, the user's avatar briefly flicks. What is the root cause of that problem?Lines 2163 to 2171 in 1eef411
Because at the above function, there are 2 icons for the non-existent user while creating a chat report. 2 icons are created because the newly added account has an account ID as optimistic one and the other ID from BE API. Till the optimistic account ID is deleted, there are 3 accounts(admin, optimistic ID, the other ID from BE API). After the optimistic account ID deleted, Lines 2343 to 2352 in 1eef411
What changes do you think we should make in order to solve the problem?We can keep the icon from flickering by filtering the optimistic ID while creating a new chat report. The optimistic ID(1) and the other ID(2) from BE API have the same name, 0 {id: 18064077, source: "https://d1wpcgnaa73g0y.cloudfront.net/ADMIN.jpeg", type: "avatar", name: "admin", fallbackIcon: ""}
1 {id: 18139679, source: "https://d2k5nsl2zxldvw.cloudfront.net/images/avatars/default-avatar_24.png", type: "avatar", name: "same@abc.com", fallbackIcon: ""}
2 {id: 1457118634, source: function, type: "avatar", name: "same@abc.com", fallbackIcon: ""} We can add a condition at if (report.lastActionType === 'CREATED' && hasSamename(report)) {
return getIconsForParticipants();
} Then only a member icon will be got when assigning a task for creating a new chat with the member. What alternative solutions did you explore? (Optional)N/A |
Backend sends the report participants correctly. So, I think we should check why the merging of the sent participants into existing report participants duly removing the optimistic participant details is not happening correctly. |
@c3024 Because non-existing user doesn't get an real participant ID on selecting an assignee stage, merging optimistic report into real report from server have made duplicate participant ID. Merging occurs on read news action function. The process is like this, Optimistic ID made -> requesting creating a task is made -> got ID from BE -> Read newest action function -> 2 ID(both for one member ID) are merged into one report -> now 2 ID -> |
📣 It's been a week! Do we have any satisfactory proposals yet? Do we need to adjust the bounty for this issue? 💸 |
Then in my opinion, this should be fixed. Merging incorrectly and then filtering by checking if names are same is a workaround and we should avoid it. |
This process is merging of Onyx from BE response. Then the merging should be able to edited to filter by checking ID. |
Then could you check where this should be fixed in |
Edited by proposal-police: This proposal was edited at 2024-08-20 16:23:34 UTC. ProposalPlease re-state the problem that we are trying to solve in this issue.Task creator avatar appears briefly on the top of the chat. This issue is hard to spot but if we screencast the whole process and try to pinpoint the exact timestamp then we can see the issue What is the root cause of that problem?When we call And in here and here, we are getting icons of What changes do you think we should make in order to solve the problem?In here, we should add a field What alternative solutions did you explore? (Optional)This can be fixed on the BE side as well. BE will need to clear the optimistic participant in the |
Minor proposal update to fix wrong word |
Given that it is recommended to update the backend response and Since we already use a pattern of omitting the optimistic ID here, as shown by @dominictb, we can apply the same approach here. The RCA and fix suggested here by @dominictb look good to me! 🎀 👀 🎀 C+ Reviewed |
Triggered auto assignment to @marcaaron, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
Hmm this sounds like something we could maybe fix by changing the behavior of how these updates are applied? Like it sounds like you are saying because we briefly set the personal details to 'null' and then apply the correct ones after it leads to this problem. But the personal details is just one object - so if we applied these updates at the same time the problem would not happen? Or no? |
The solution we applied there looks like a hack to me kind of. Also what will be shown instead? Please post a video of the UX so we can see what this flow looks like with the change applied. Is there some empty space where an avatar should be? |
This sounds better IMO, but might not be valuable enough to spend time on right now. |
Actually, it's the other way around. Here's the flow:
I agree. I think, generally and not just in this specific case, that unless the @dominictb correct me if I am wrong. |
I'll send the video in a bit. |
Ok, got it, thanks for the explanation @c3024. It still sounds like a possible "root cause" is that we are not merging together these two updates, but merging in the server data first then the
Hmm I think perhaps the server should just be responsible for the part of Given how our system works and applies updates the current behavior makes sense. There is no differentiation between optimistic and actual data. But exposing that detail to the frontend might not be the answer to me. So, I'd think we'd either:
OR
OR
Honestly, since everything ends up looking how it should look I'm not sure if we should be doing the proposed solution. Going to ask what the internal team thinks about this one. |
@marcaaron, when I pulled the code, the steps you mentioned didn’t work as expected. The assigned task isn't showing up in the top menu. |
Yes, that is the root cause. As I mentioned here:
the comment suggests merging response data and All three solutions you suggested are indeed more ideal than filtering the optimistic ID on the frontend.
Yes, the three avatars appear for a very brief time, and sometimes it happens so quickly that it’s not perceptible at all. We can leave this as it is and close this issue. Perhaps this brainstorming will be useful if we encounter a situation where the gap between updates actually causes a significant UI/UX issue. |
It is in my local machine and possibly your local machine but not in the OP's machine, or any user's browser. It is not guaranteed at all.
It is in fact the correct and recommended design. The response data should be merged first, acknowledging that we have received data from the server before we move forward with the
But the ideal UX in this way, should be the change of optimistic participant record -> BE-returned participant record without any disappearing gap.
I don't feel like it. BE should never be responsible for cleaning up optimistic data in the FE, because BE will never have the full context of what is optimistic data by generated by FE, and BE should not need to know that. FE should be the one responsible for cleaning up optimistic data and other related optimistic UX (including hiding/disable optimistic data), making sure that the UI makes sense to the end user. This is why I advocate for FE strategy in other issue and this issue as well. |
I did not mean that we can apply them simultaneously. I understand that we should have the backend response before doing anything with |
Thinking about it, since we have this PR Expensify/react-native-onyx#490 merged, can we reliably do |
@c3024 Let me know you if I found a solution. |
Exactly the report having the issuable merging was made just after "GetMissingOnyxMessages" request. Here is the process when after creating a task:
[Debug] [info] [OnyxUpdateManager] Applying update type: https with lastUpdateID: 1295849174 - {"command":"GetMissingOnyxMessages"} – ""
[Debug] [info] [Onyx] merge called for key: OnyxUpdatesLastUpdateIDAppliedToClient hasChanged: true - "" – ""
[Debug] [info] [Onyx] set called for key: nvp_quickActionGlobalCreate properties: action,chatReportID,isFirstQuickAction,targetAccountID hasChanged: true - "" – ""
[Debug] [info] [Onyx] set called for key: userMetadata properties: accountID,email,freeTrial,planType,role,tryNewDotDismissed hasChanged: false - "" – ""
[Debug] [info] [Onyx] merge called for key: personalDetailsList properties: 17907433,18187017 hasChanged: true - "" – ""
|
@marcaaron @bfitzexpensify @c3024 this issue was created 2 weeks ago. Are we close to approving a proposal? If not, what's blocking us from getting this issue assigned? Don't hesitate to create a thread in #expensify-open-source to align faster in real time. Thanks! |
Can someone maybe explain why there is a delay for some users and other times not? This seems to point even further to a problem at some lower level with Onyx. My expectation is that even if we are applying the server data followed by the Anyways, I think this pretty low priority. Maybe we should just close it out @bfitzexpensify ? |
Actually I'm going to close and if there is enough compelling evidence to point to we can reopen. |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Version Number: 9.0.18-7
Reproducible in staging?: Y
Reproducible in production?: Y
If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/4836876
Email or phone of affected tester (no customers): applausetester+jp_e_category_2@applause.expensifail.com
Logs: https://stackoverflow.com/c/expensify/questions/4856
Issue reported by: Applause-Internal team
Action Performed:
Expected Result:
Task assignee avatar present on the top of the chat
Actual Result:
Task creator avatar appears briefly on the top of the chat
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Bug6566324_1723174921955.Task_non-ex.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @c3024The text was updated successfully, but these errors were encountered: