Closed m-natarajan closed 3 months ago
This has been labelled "Needs Reproduction". Follow the steps here: https://stackoverflowteams.com/c/expensify/questions/16989
Triggered auto assignment to @jliexpensify (Bug
), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.
Problem Statement: Messages are not displaying in the LHN (Left Hand Navigation) when someone sends a message, resulting in users missing important notifications and updates.
Root Cause: The root cause of the problem is likely due to an issue with the message rendering logic, WebSocket connection, or data storage.
Changes to Solve the Problem: To solve the problem, I propose the following changes:
// Update message rendering logic const MessageList = () => { const messages = useSelector((state) => state.messages); const dispatch = useDispatch();
useEffect(() => { dispatch(fetchMessages()); // Fetch messages on component mount }, [dispatch]);
return (
); };
// Verify WebSocket connection const socket = new WebSocket('wss://example.com/ws');
socket.onmessage = (event) => {
console.log(Received message: ${event.data}
);
// Handle incoming message and update LHN
};
socket.onopen = () => { console.log('WebSocket connection established'); };
socket.onerror = (event) => { console.error('WebSocket error:', event); };
-- Check message storage in database SELECT * FROM messages WHERE recipient_id = [user_id]; Alternative Solutions Explored:
Use a Different Message Rendering Library: Explore alternative message rendering libraries, such as react-chat-elements, to see if they provide better performance and reliability. Implement Message Queueing: Implement message queueing to ensure that messages are processed and displayed in the correct order, even in cases of high traffic or network latency. Add Error Handling: Add error handling to the message rendering logic to catch and display any errors that may occur, providing a better user experience.
I can reproduce this with only one person in my LHN - @SofiedeVreese. All of her messages don't appear unless I click out of her chat and back in.
I think this will be hard to accurately repro, but it can be reproduced.
Job added to Upwork: https://www.upwork.com/jobs/~01263f65273fb956e2
Triggered auto assignment to Contributor-plus team member for initial proposal review - @dukenv0307 (External
)
I think this should be criticial in newDot quality since it affects core chat workflow cc @muttmuure
Should we make this Internal
or keep as External
?
Triggered auto assignment to @lakchote (AutoAssignerNewDotQuality
)
I got some messages from @iwiznia today, and the LHN isn't showing the chat as unread. I looked at onyx and it doesn't look like the report actions are in there, which explains why the message isn't being marked as unread. I think the issue we're seeing in this case is that the messages aren't being delivered to the client
This from gmail
And these are the last 3 report actions in onyx for that reportID
[
{
"html": "I used our social channel, but maybe I can use a better one, like a public channel",
"text": "I used our social channel, but maybe I can use a better one, like a public channel",
"type": "COMMENT",
"whisperedTo": []
}
]
[
{
"html": "Do you know one with many many participants?",
"text": "Do you know one with many many participants?",
"type": "COMMENT",
"whisperedTo": []
}
]
[
{
"html": "Yeah I think it runs a lot which is why I think 10-12ms <em>could</em> be a problem",
"text": "Yeah I think it runs a lot which is why I think 10-12ms could be a problem",
"type": "COMMENT",
"whisperedTo": []
}
]
After opening the chat, I get all the messages
[
{
"type": "COMMENT",
"html": "Yeah I think it runs a lot which is why I think 10-12ms <em>could</em> be a problem",
"text": "Yeah I think it runs a lot which is why I think 10-12ms could be a problem",
"isEdited": false,
"whisperedTo": [],
"isDeletedParentAction": false,
"deleted": "",
"reactions": []
}
]
[
{
"type": "COMMENT",
"html": "And more importantly it runs on many writes.",
"text": "And more importantly it runs on many writes.",
"isEdited": false,
"whisperedTo": [],
"isDeletedParentAction": false,
"deleted": "",
"reactions": []
}
]
[
{
"type": "COMMENT",
"html": "So 5x on 2ms to 10ms is probably fine, but if there's indeed some that take 50ms and those are also x 10 that would be 500ms which might be bad",
"text": "So 5x on 2ms to 10ms is probably fine, but if there's indeed some that take 50ms and those are also x 10 that would be 500ms which might be bad",
"isEdited": true,
"whisperedTo": [],
"isDeletedParentAction": false,
"deleted": "",
"reactions": []
}
]
[
{
"type": "COMMENT",
"html": "<blockquote>Do you know one with many many participants?</blockquote>No, but yes, probably some of the public channels",
"text": "Do you know one with many many participants?\nNo, but yes, probably some of the public channels",
"isEdited": false,
"whisperedTo": [],
"isDeletedParentAction": false,
"deleted": "",
"reactions": []
}
]
[
{
"type": "COMMENT",
"html": "Once you find it, you should add it to the PR template: <a href=\"https://github.com/Expensify/Auth/blob/main/.github/PULL_REQUEST_TEMPLATE.md?plain=1#L21\" target=\"_blank\" rel=\"noreferrer noopener\">https://github.com/Expensify/Auth/blob/main/.github/PULL_REQUEST_TEMPLATE.md?plain=1#L21</a>",
"text": "Once you find it, you should add it to the PR template: https://github.com/Expensify/Auth/blob/main/.github/PULL_REQUEST_TEMPLATE.md?plain=1#L21",
"isEdited": false,
"whisperedTo": [],
"isDeletedParentAction": false,
"deleted": "",
"reactions": []
}
]
[
{
"type": "COMMENT",
"html": "Maybe one of those will do? I assumed big chats mean lots of messages though, not lots of people.",
"text": "Maybe one of those will do? I assumed big chats mean lots of messages though, not lots of people.",
"isEdited": false,
"whisperedTo": [],
"isDeletedParentAction": false,
"deleted": "",
"reactions": []
}
]
[
{
"type": "COMMENT",
"html": "Yep, just checked, those are chats with only 2 people",
"text": "Yep, just checked, those are chats with only 2 people",
"isEdited": false,
"whisperedTo": [],
"isDeletedParentAction": false,
"deleted": "",
"reactions": []
}
]
Investigated this with @cead22. Here are logs from his device. One of the messages I sent and he was not seeing has actionID of 5285273928576337160
Conclusions are:
[App] 2024-07-18T16:22:28.159Z - [info] [Report] Handled multipleEvents event sent by Pusher ~~ updates: '[0: '[data: '[0: '[key: 'report_64983050' onyxMethod: 'merge' value: '[chatType: '' lastActorAccountID: '2536717' lastMessageText: '<REDACTED>' lastVisibleActionCreated: '2024-07-18 16:22:19.266' managerID: '' parentReportActionID: '' parentReportID: '' participants: '[2536717: '[hidden: '']']' policyID: '_FAKE_' reportID: '64983050' reportName: 'Chat Report' stateNum: '0' statusNum: '0' type: 'chat' visibility: '']']' 1: '[key: 'reportActions_64983050' onyxMethod: 'merge' shouldShowPushNotification: '1' value: '[5285273928576337160: '[actionName: 'ADDCOMMENT' actorAccountID: '2536717' avatar: 'https://d1wpcgnaa73g0y.cloudfront.net/eb8f557c896f180c5e464001102be4c417f436e2_128.jpeg' created: '2024-07-18 16:22:19.266' lastModified: '2024-07-18 16:22:19.266' message: '[0: '[html: '<REDACTED>' text: '<REDACTED>' type: 'COMMENT' whisperedTo: '[]']']' originalMessage: '[html: '<REDACTED>' lastModified: '2024-07-18 16:22:19.266']' person: '[0: '[style: 'strong' text: '<REDACTED>' type: 'TEXT']']' previousReportActionID: '3689954795802921812' reportActionID: '5285273928576337160' shouldShow: '1']']']' 2: '[key: 'personalDetailsList' onyxMethod: 'merge' value: '[2536717: '[accountID: '2536717' avatar: 'https://d1wpcgnaa73g0y.cloudfront.net/eb8f557c896f180c5e464001102be4c417f436e2_128.jpeg' displayName: 'Ionatan Wiznia' firstName: 'Ionatan' lastName: 'Wiznia' login: 'ionatan@expensify.com' phoneNumber: '' pronouns: '__predefined_callMeByMyName' status: '' timezone: '[automatic: '1' selected: 'Europe/Madrid']' validated: '1']']']']' eventType: 'onyxApiUpdate']']' lastUpdateID: '634937822' previousUpdateID: '634749228' userAgent: 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36'
. You can see the ADDCOMMENT action with the ID mentioned above[info] [Onyx] merge called for key: reportActions_64983050 properties
with the actionID in it, but we don't see that till here at 2024-07-18T16:55:23.491Z
(local time)My guess is that the bug is that client needs to be updated here but something in OnyxUpdates.saveUpdateInformation is going wrong and the update is never applied.
The PR I sent will log whenever we detect the onyx updates need updating.
Shit.. we have two issues for this! I was able to reproduce this week and shared onyx data with Puneet. Check this thread
Since you sent a PR Ioni, I should close the other one, right? it's here
I just has an instance where LHN and the chats in #social didn't update. I had a sneaking suspicion they weren't so I captured onyx data, refreshed, then saw new chats load. Hope it's helpful (or you're able to find the logs and those are helpful) social not loading updating.txt
Onyx data before clicking on the room. social not updating onyx.txt
Onyx data after clicking on the chat and opening the room. Social onyx data AFTER chat updated.txt
Let me know if there's anything I can do to help get this fixed.
We're discussing the latest theory here: https://expensify.slack.com/archives/C05LX9D6E07/p1721679415535579?thread_ts=1721217121.843389&cid=C05LX9D6E07
Hi, I am Alexey from Margelo and I can work on this issue.
📣 @dukenv0307 🎉 An offer has been automatically sent to your Upwork account for the Reviewer role 🎉 Thanks for contributing to the Expensify app!
lonnnnng thread in #newdot-quality here We encountered the bug this week but the last ~24 hours we haven't been able to reproduce, so we're pausing. #expensify-open-source post asking if others are experiencing.
@puneetlath @Kureev @jliexpensify @dukenv0307 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!
I think.. hope.. we're all fixed here. Read the [POST MORTEM] Staging jobs not processing
email for more deets. Thanks Ioni, Franc and Flo (what a trio of names!)
Shit... on the latest desktop staging build and chats didn't load after restarting my computer and opening NewDot (I think I updated the app this morn too).
What I see in Desktop now
What I see when I open new.expensify.com in Firefox
Gonna share in the thread too
Gonna close this cuz the initial bug here appears to be "I'm active in NewDot and new chats are showing in LHN" where my issue is "After having my laptop closed for some time, I opened Desktop and chats aren't sending (which is likely a reconnect issue)". More discussion here and a new thread for my specific bug here
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: Reproducible in staging?: needs reproduction Reproducible in production?: needs reprroduction 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 Expensify/Expensify Issue URL: Issue reported by: @cead22
Slack conversation: https://expensify.slack.com/archives/C049HHMV9SM/p1720045541007929
Action Performed:
Expected Result:
UserB's message should update in the LHN
Actual Result:
Message does not appear in the LHN and user A has to switch to another chat and open the chat report from B to appear the message
Workaround:
unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
SS before chat :
When opening chat with B
After opening the chat
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @lakchote