-
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
[$1000] Chat - Offline sent messages with emojis added are displayed without emojis after going online #17110
Comments
Triggered auto assignment to @stephanieelliott ( |
Bug0 Triage Checklist (Main S/O)
|
@stephanieelliott Uh oh! This issue is overdue by 2 days. Don't forget to update your issues! |
1 similar comment
@stephanieelliott Uh oh! This issue is overdue by 2 days. Don't forget to update your issues! |
I was able to repro this on iOS/Safari |
Job added to Upwork: https://www.upwork.com/jobs/~01dfa3e3f4c38de68c |
Current assignee @stephanieelliott is eligible for the External assigner, not assigning anyone new. |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @eVoloshchak ( |
Triggered auto assignment to @bondydaa ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.Chat - Offline sent messages with emojis added are displayed without emojis after going online What is the root cause of that problem?When sending a message and then adding the emoji, the app will be received 2 eventData from pusher in the correct order, the first one is adding a new message (pushJSON 1) and the second one is adding emoji (pushJSON 2). But the application will update pushJSON 2 into ONYX before updating pushJSON 1. So that the pushJSON 1 will override the pushJSON 2 and the change of pushJSON 2 will not be saved in ONYX This line makes pushJSON update order reversed. Line 473 in 71b6b1a
To explain this, we can take a look at this function App/src/libs/Network/SequentialQueue.js Lines 31 to 53 in 71b6b1a
We just run update callback when SequentialQueue.getCurrentRequest() or process() get finished, but the currentRequest is re-assign to the next request and run process() recursively if the persistedRequests is not empty. That makes the callbacks are executed in the reverse order
What changes do you think we should make in order to solve the problem?in here Lines 472 to 478 in 71b6b1a
After theCurrentRequest is resolved, we shouldn't update the PushJSON into ONYX immediately. First, we should push all PushJSON into a new array. After all, pushJSONs are added to the new array (The order of pushing pushJSONs into the array is being reversed), we will reverse the new array and update each element of the new array to ONYX This is the demo code
What alternative solutions did you explore? (Optional)NA Result |
There are several similar issues, #15998 (comment) |
I DM'd @neil-marcellini to see if he could confirm if #12775 would also fix this or not. |
Since it's two write actions taken while offline, and then a refresh is required to see the correct state, it's very likely the replay effect. I'll add it to the tracking issue. |
awesome thank you. throwing a hold on this and taking off help wanted for now. We can retest once and re-add once the main PR(s) are merged. |
Main PRs are still open, this is still on hold. |
The replay effect fix is on staging so I'll take this off of hold and we can retest. |
It looks like it's mostly fixed, but there's still a problem with the first reacted message. Screen.Recording.2023-05-16.at.8.47.57.AM.mov |
After checking the code carefully, i noticed that the function |
Pusher events should not be sent to the requesting client because we use a Pusher socket_id to prevent sending the events to that socket. Can you add logging and provide evidence that we are in fact receiving Push events here? If so then we'll have to figure out why the socket is still receiving the events. |
Hi! I think it's possible that what you're seeing is the same as #16506 that I've been working on for a couple of weeks 😅 . If you can verify it's the same issue, then you can ignore it for now. |
Ah yes, that seems like it may be the same issue. Will leave this open a bit longer for others to confirm for themselves though! |
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:
Expected Result:
Emojis should stay
Actual Result:
Emojis disappear until page refresh
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Version Number: 1.2.96.0
Reproducible in staging?: Yes
Reproducible in production?: Yes
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
Bug6009088_video_63.mp4
Expensify/Expensify Issue URL:
Issue reported by: Applause - Internal Team
Slack conversation:
View all open jobs on GitHub
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: