-
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] Thread - App shows join button after user joined offline #46004
Comments
Triggered auto assignment to @alexpensify ( |
Triggered auto assignment to @srikarparsi ( |
👋 Friendly reminder that deploy blockers are time-sensitive ⏱ issues! Check out the open `StagingDeployCash` deploy checklist to see the list of PRs included in this release, then work quickly to do one of the following:
|
We think this issue might be related to the #vip-vsb. |
Production Recording.2636.mp4 |
At first glance, this seems like a frontend issue 🤔 I see LeaveRoom was called when the user got back online but maybe we should have also called the Api command to rejoin the thread? |
This looks frontend, going to try applying the external label |
Job added to Upwork: https://www.upwork.com/jobs/~0114c22d59f2094554 |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @brunovjk ( |
ProposalPlease re-state the problem that we are trying to solve in this issue.After creating a thread, if a user was to go offline then leave the thread and then rejoin, the join button will appear on the screen when it is not supposed to be there. What is the root cause of that problem?When the user is brought back online the Sequential Queue processes the requests that weren't able to be made while the user is offline. What changes do you think we should make in order to solve the problem?Add a pending field to our notification update function so we have a flag to look for while we're processing actions. const optimisticData: OnyxUpdate[] = [
{
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT}${reportID}`,
value: {
notificationPreference: newValue,
pendingFields: {
notificationPreference: CONST.RED_BRICK_ROAD_PENDING_ACTION.UPDATE
}
},
},
];
const successData: OnyxUpdate[] = [
{
onyxMethod: Onyx.METHOD.MERGE,
key: `${ONYXKEYS.COLLECTION.REPORT}${reportID}`,
value: {
pendingFields: {
notificationPreference: null
}
},
},
]; Then modify our canJoin boolean to read that flag and be patient. const isPendingNotificationUpdate = report?.pendingFields?.notificationPreference
const canJoin = useMemo(() => {
if (isPendingNotificationUpdate) {
return false
}
return ReportUtils.canJoinChat(report, parentReportAction, policy);
}, [isPendingNotificationUpdate]) Here is a test branch with my changes What alternative solutions did you explore? (Optional)N/A |
To clarify from the issue body, the join button does disappear after a moment. The leave button isn't currently in prod so it's a little difficult to compare. @mountiny do you know if this is expected with the sequential queue or should this be fixed? Screen.Recording.2024-07-24.at.4.30.02.AM.mov |
Current assignee @srikarparsi is eligible for the choreEngineerContributorManagement assigner, not assigning anyone new. |
Personally, in my three weeks contributing so far, I think this is the third time I've come across an offline/online issue where the queue is processing causing state to repeatedly re-render. Sometimes it's handled and sometimes it isn't. It makes me wish Onyx had an offline state and the sequential queue was a plugin that informs Onyx when it's empty and it's safe to output the results. |
Thanks for the proposals so far. Can you identify which PR from the checklist caused the regression? Anyway, going to demote as a polish issue since it's for offline behavior that doesn't break any critical flow. |
I think this is happening as we process the API commands in the backend and we queue the relevant onyx updates. First, the app processes, leaving the thread so it gets hidden and then it joins again. I think we do not have to worry about this one too much and might even close it |
I agree, closing this one out since the expected behavior (the join button not showing) does occur, it just takes a second because of the sequential queue. |
If you haven’t already, check out our contributing guidelines for onboarding and email [email protected] to request to join our Slack channel!
Version Number: v9.0.11-0
Reproducible in staging?: Y
Reproducible in production?: N
If this was caught during regression testing, add the test name, ID and link from TestRail: https://expensify.testrail.io/index.php?/tests/view/4753350
Email or phone of affected tester (no customers): [email protected]
Logs: https://stackoverflow.com/c/expensify/questions/4856
Issue reported by: Applause-Internal team *
Action Performed:
Expected Result:
The user stays joined back in the thread
Actual Result:
The join button reappears again and user has to click join again
Workaround:
Unknown
Platforms:
Which of our officially supported platforms is this issue occurring on?
Screenshots/Videos
Bug6549717_1721667673800.bandicam_2024-07-22_19-54-35-010.mp4
View all open jobs on GitHub
Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @brunovjkThe text was updated successfully, but these errors were encountered: