-
Notifications
You must be signed in to change notification settings - Fork 10.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
Scheduled push notification is not sent immediately when user switches from online to away/offline #19097
Comments
I'm not sure who publishes this event but
|
My plan:
|
I've made fix locally and tested it working. I'll submit a PR soon. |
…line to away/offline Fixes RocketChat#19097
…line to away/offline Fixes RocketChat#19097
PR submitted as #19104, I hope @sampaiodiego can review and merge. Thank you in advance for accepting my contribution. 🙏 |
…line to away/offline Fixes RocketChat#19097
hi @ceefour .. thanks a lot for your efforts and investigation, really appreciate that =) the actual purpose of this "delay" before sending a notification was mainly to prevent people from receiving notification during a page reload or network instability (please correct me if I'm wrong @rodrigok ).. but I see the frustration it can cause when you're online go were away/offline "on purpose", which will cause the notifications to be delayed, but in this case you'd like to receive them right away.. thinking on this, maybe decreasing the delay would already be very beneficial.. it can already be controlled via an env var called |
@sampaiodiego my "on purpose" retaining online status is for reproducing purposes. However, it is still possible that Rocket.Chat status will be "online" longer than it should, during typical usage. It has happened several times with several of our users, with varying Android devices. I do feel 20 s is a better delay if this fix is rejected. But if this fix is applied, then a 120 s delay is acceptable. I like this fix better because it's as close as possible to realtime, in any situation. |
I'm glad to see lots of progress on this, and the original updates as part of #17357, but it's really unfortunate I had to find this bug report and related PRs to realize that the documentation is seriously out of date. Specifically:
Neither mentions 120s, nor the option to configure via ENV var. Any chance to get those updated as well so others don't go through the effort I did in finding this information? |
Description:
New push notification scheduling behavior introduced by #17357 (@rodrigok) and #17907 (@sampaiodiego) is really awesome! But when user switches from (inaccurate) online to away/offline, push notification still waits for 120 seconds to expire. It needs to be sent immediately (from #17357 (comment)).
Steps to reproduce:
statusConnection
is stillonline
(this is another issue probably for Rocket.Chat.ReactNative how this sometimes can happen, but it does happen and quite easy to reproduce by just using the phone's task killer)offline
. But this works: open Rocket.Chat for Android, turn on airplane mode, kill the app, turn off airplane mode, now Rocket.Chat server user'sstatusConnection
is stillonline
.statusConnection
isonline
according to server, meaning push is scheduled in 120 secondsstatusConnection
is now eitheroffline
oraway
.Expected behavior:
When a user's
statusConnection
becomesoffline/away
, server sends all delayed push notifications immediately.Actual behavior:
Server still waits all delayed push notifications, even when a user's
statusConnection
becomesoffline/away
.Server Setup Information:
3.7.0
branchlocal
Client Setup Information
Additional context
I'd like to contribute a fix, but I need some guidance of what files/functions are relevant
Relevant logs:
The text was updated successfully, but these errors were encountered: