-
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
[Awaiting Payment April 29th] HIGH: [Performance] [$500] Reliably unsubscribe from isTyping events when leaving rooms #38905
Comments
Auto-assigning issues to engineers is no longer supported. If you think this issue should receive engineering attention, please raise it in #whatsnext. |
Triggered auto assignment to @dylanexpensify ( |
Nice! @quinthar is this something we wanna get a contributor on? |
yes please! |
Job added to Upwork: https://www.upwork.com/jobs/~012a36c87d591ea59b |
Triggered auto assignment to Contributor-plus team member for initial proposal review - @jjcoffee ( |
Let's get it! |
ProposalPlease re-state the problem that we are trying to solve in this issue.We need to unsubscribe from isTyping events when leaving rooms. What is the root cause of that problem?Pusher remains subscribed even after leaving the room. What changes do you think we should make in order to solve the problem?In ReportActionsView.ts, we are calling We can call the below to unsubscribe in a useEffect when component unmounts:
|
ProposalPlease re-state the problem that we are trying to solve in this issue.When you join a room, you subscribe to various Pusher channels that should only be active while in that room. However, when you leave the room, sometimes it doesn't unsubscribe you from the channels. This "leak" will gradually slow down the app. What is the root cause of that problem?In here, we already have the logic to unsubscribe from the What changes do you think we should make in order to solve the problem?We need to unsubscribe from report channel if the screen loses focus, and the reportId is no longer the topmostReportId. Then we'll resubscribe if the report screen gains focus. We might want to do it in Pseudo-code (to replace this event subscription logic, some more polishing might be needed)
Then we can remove the existing unsubscription logic here What alternative solutions did you explore? (Optional)NA |
I like the sound of @tienifr's proposal! The RCA looks to be correct, since we already unsubscribe on unmount (which is why it only sometimes sends the @ShridharGoel's proposal is lacking an RCA and generally in details, for example the solution refers to a non-existent method 🎀👀🎀 C+ reviewed |
Triggered auto assignment to @Beamanator, see https://stackoverflow.com/c/expensify/questions/7972 for more details. |
There are a couple of extra cases I've found that we need to handle on the PR. Waiting on @tienifr to look into it 🙏 |
Issue not reproducible during KI retests. (First week) |
@tienifr - I see @Beamanator responded. What are the next steps, and your ETA? |
It is delayed because I need time to check if the new changes work and do not cause errors. |
What's the update here? |
oh I see it's merged! |
Yes sorry for not updating here! Was merged 3 days ago, on staging as of 7 hours ago 🙏 🚀 |
Can we close this? |
Hmm this has been in prod for only 3 days now, so i don't believe we should close - we normally wait 7 days before payment & before considering the PR having caused no regressions |
Should this be tagged |
Aah true, I think that automation wasn't working one day last week, so I manually updated 👍 @dylanexpensify FYI looks like payment is due today! 😅 |
Wahooo! Will do it! |
done! @jjcoffee can we get checklist sorted? |
Regression Test Proposal
Do we agree 👍 or 👎 |
@Beamanator, @jjcoffee, @dylanexpensify, @tienifr Uh oh! This issue is overdue by 2 days. Don't forget to update your issues! |
nice! |
done! |
Problem:
When you join a room, you subscribe to various Pusher channels that should only be active while in that room. However, when you leave the room, sometimes it doesn't unsubscribe you from the channels. This "leak" will gradually slow down the app. But particularly concerning is that it will cause you to receive Pusher events that do not relate to the current room (such as "istyping" events in rooms you aren't looking at), and thus drag down your performance.
Solution:
Reliably unsubscribe from the room's Pusher channel when leaving by any method. There is a theory that we do this when leaving a room to switch to another, but perhaps not when leaving the room to go to a non-room page (eg, Settings).
See: https://expensify.slack.com/archives/C049HHMV9SM/p1711131919203929
Upwork Automation - Do Not Edit
The text was updated successfully, but these errors were encountered: