Skip to content
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

[BREAK] Suspend push notifications when login token is invalidated #20913

Merged
merged 22 commits into from
Jun 30, 2022

Conversation

gabrieleiro
Copy link
Contributor

Proposed changes (including videos or screenshots)

link the auth token to the push token

Issue(s)

Steps to test or reproduce

Further comments

app/push/server/methods.js Outdated Show resolved Hide resolved
@CLAassistant
Copy link

CLAassistant commented Dec 17, 2021

CLA assistant check
All committers have signed the CLA.

@pierre-lehnen-rc pierre-lehnen-rc changed the base branch from develop to master February 14, 2022 23:57
@pierre-lehnen-rc pierre-lehnen-rc changed the base branch from master to develop February 14, 2022 23:57
@pierre-lehnen-rc pierre-lehnen-rc changed the title [FIX] push notifications for unauthenticated users [BREAK] Suspend push notifications when login token is invalidated Apr 22, 2022
@pierre-lehnen-rc
Copy link
Contributor

pierre-lehnen-rc commented May 4, 2022

Once this change is merged, Rocket.Chat will no longer send notifications to old user sessions. Users will have to open the mobile app to start receiving notifications again. We should do something to prevent that.

Copy link
Contributor

@pierre-lehnen-rc pierre-lehnen-rc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Create a migration to update the existing push tokens with an expiration date (one week into the future) and a countdown of number of notifications.

When sending a push notification to a push token that doesn't have a login token we should validate this expiration date and continue sending notifications until the date is reached. After the expiration date we decrease the countdown number for each notification we send. Once the countdown reaches zero, we stop sending notifications to that token.

The raix:push-update method should also erase this expiration and countdown information when a push token is updated.

This way, we'll give users enough time to open the app and renew their push tokens without losing any notifications.

@pierre-lehnen-rc pierre-lehnen-rc added this to the 5.0.0 milestone Jun 24, 2022
@ggazzo ggazzo added stat: ready to merge PR tested and approved waiting for merge and removed stat: needs QA labels Jun 30, 2022
@kodiakhq kodiakhq bot merged commit 8db9e7f into develop Jun 30, 2022
@kodiakhq kodiakhq bot deleted the push-token branch June 30, 2022 13:15
@murtaza98 murtaza98 mentioned this pull request Jul 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants