-
Notifications
You must be signed in to change notification settings - Fork 9
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
Refactor notification stream syncing code for tandem use by bot service #2280
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
62e06e4
to
2477d89
Compare
One thing to note is that currently the notification service misses events during downtime. There is still a wish to make the sync cookies persistent so the notification service can resume processing events after it resumed working. This is probably also required for other services. |
Oof, we probably don't want to miss events for the bot registry service. |
d4550ef
to
47a2e3c
Compare
…as well, because initially the bot service will also track all channel streams as well as user and user inbox streams.
The actual streams tracker will be sufficiently different for each service that it makes sense to go ahead and implement them separately: the notification service cares about all DM, GDM, and channel streams, and tracks all of these, but the bot registry service only cares about streams associated with a registered bot, and the channels in the spaces that bot belongs to. Furthermore, channel streams are sometimes picked up on allocation by the notification service, but they are almost always going to be added retroactively for the bot registry service at the point at which we detect a bot has been added to a channel.
However, the logic for keeping an up-to-date internal copy of the view of each stream, and for syncing that stream, are very similar. This PR refactors those common elements into a shared library and plugs them back into the notification service.