-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Do not re-subscribe to Pusher when clicking on desktop notification #3893
Comments
Triggered auto assignment to @Christinadobrzyn ( |
My best guess is that this issue is related to how we are navigating to a report. If we are already on the report we should either reveal the report or do nothing rather than "navigate" to it (which might be reloading it). Something else could be going on but that's what I'd check out first. |
hey @marcaaron Testing this to better understand what needs to be fixed.
Will you confirm the issue we want to fix is the delayed upload of the most recent message in a chat? |
Hello, I am not 100% certain about logs referenced in the first post, but here is how I reproduced the issue:
Here is quick reproduction demo video (steps 6-9): 3893-repro.mp4ProposalAnd just as @marcaaron said, the fix is as simple as preventing the navigation if requested route is the current one: --- a/src/libs/Navigation/Navigation.js
+++ b/src/libs/Navigation/Navigation.js
@@ -58,7 +58,8 @@ function navigate(route = ROUTES.HOME) {
// Navigate to the ReportScreen with a custom action so that we can preserve the history. We're looking to see if we
// have a participants route since those should go through linkTo() as they open a different screen.
const {reportID, isParticipantsRoute} = ROUTES.parseReportRouteParams(route);
- if (reportID && !isParticipantsRoute) {
+
+ if (reportID && !isParticipantsRoute && navigationRef.current.getCurrentRoute().path !== `/${route}`) {
navigationRef.current.dispatch(CustomActions.pushDrawerRoute(SCREENS.REPORT, {reportID}));
return;
} Here is a video with a fix working (no unsubscribe event, no chat redrawing): 3893-fix.mp4Thanks. |
@marcaaron I don't think there's a way to keep the history in our Drawer without reseting the navigation state. We could try:
But I'm not convinced it's worth it, our implementation works well apart from the remount. To fix this one we have to skip the reset when we're navigating to the same report.
|
@dklymenk that proposal is half of the story as we need to control the drawer + dismiss any modals
@rdjuric I'm inclined to agree with you here. And the proposal sounds like it's moving in the right direction (perhaps we can find a better way still in the review). I do wish there was a simpler way, but keeping some semblance of browser history is also a priority for us. |
PR is up at #3945! Do you want to take a look at it @marcaaron? Pullerbear requested a review from someone else 😅 |
I think I missed the step of adding the Eng label to this so I'm going to do that so we can get another engineer in here just in case Marc is busy. |
Triggered auto assignment to @nickmurray47 ( |
Created Upwork Job |
Hey there @nickmurray47 or @marcaaron can you let me know if the PR looks good for this project? Thanks! |
Taking a look now! |
The proposal looks good to me as far as I can tell. I had the same kinda nitpicky concern that @rdjuric brought up with the hard-coded line |
It looks like the PR has been merged already? |
PR was merged, holding for 7 days to ensure no regressions and will pay in Upwork on Friday July 16 (given the 7th day is a Saturday) |
@Christinadobrzyn Thanks, Christina! Just a note that the PR was merged 3 days ago @nickmurray47 nice, I'll open another PR to improve that line later |
@rdjuric is paid in Upwork! Thank you for working on this! |
If you haven’t already, check out our contributing guidelines for onboarding and email contributors@expensify.com to request to join our Slack channel!
Action Performed:
Clicking on a desktop web (Chrome) notification
Expected Result:
Does not unsubscribe then re-subscribe to Pusher
Actual Result:
It seems to always unsubscribe and resubscribe from Pusher
Workaround:
Just use the app as normal. This is indicative of reloading the chat unnecessarily.
Platform:
Web
iOS
Android
Desktop App
Mobile Web
Version Number:
Logs: https://stackoverflow.com/c/expensify/questions/4856
Notes/Photos/Videos: Any additional supporting documentation
Expensify/Expensify Issue URL:
View all open jobs on Upwork
The text was updated successfully, but these errors were encountered: