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

fix: remove device tokens on any errors #13

Merged
merged 1 commit into from
Feb 22, 2024

Conversation

link2xt
Copy link
Contributor

@link2xt link2xt commented Feb 22, 2024

410 case seems to be dead code because 410 errors are actually returned as Err case, not Ok.

There are also errors 400 according to the log.

Fixes #12

410 case seems to be dead code because 410 errors are actually
returned as Err case, not Ok.

There are also errors 400 according to the log.
@link2xt
Copy link
Contributor Author

link2xt commented Feb 22, 2024

I have deployed it now and it started removing tokens for various reasons ("Unregistered", "DeviceTokenNotForTopic") etc.
We currently have more than 16400 devices "registered", it takes forever to deliver notifications:

Feb 19 01:36:56 page notifiers[155882]: {"level":30,"time":1708306616463,"msg":"sending notifications to 16393 devices"}
Feb 19 02:41:03 page notifiers[155882]: {"level":30,"time":1708310463541,"msg":"sending notifications to 16394 devices"}
Feb 19 03:17:10 page notifiers[163950]: {"level":30,"time":1708312630854,"msg":"sending notifications to 16394 devices"}
Feb 19 04:31:01 page notifiers[163950]: {"level":30,"time":1708317061976,"msg":"sending notifications to 16394 devices"}
Feb 19 05:27:36 page notifiers[163950]: {"level":30,"time":1708320456560,"msg":"sending notifications to 16394 devices"}
Feb 19 06:29:58 page notifiers[163950]: {"level":30,"time":1708324198687,"msg":"sending notifications to 16394 devices"}

(see the interval between log messages)

It is supposed to send notifications every 20 minutes, but sending to all devices already takes about one hour. Let's see how it goes once we actually prune broken tokens.

@link2xt link2xt merged commit 00f4bf5 into main Feb 22, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Notification failure does not result in token removal
2 participants