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

Refactor notification stream syncing code for tandem use by bot service #2280

Merged
merged 15 commits into from
Feb 8, 2025

Conversation

clemire
Copy link
Contributor

@clemire clemire commented Feb 7, 2025

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.

Copy link

vercel bot commented Feb 7, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
river-sample-app ⬜️ Ignored (Inspect) Visit Preview Feb 8, 2025 3:00am

@clemire clemire force-pushed the crystal/refactor-event-processing branch from 62e06e4 to 2477d89 Compare February 7, 2025 00:56
@bas-vk
Copy link
Contributor

bas-vk commented Feb 7, 2025

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.

@clemire
Copy link
Contributor Author

clemire commented Feb 7, 2025

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.

@clemire clemire force-pushed the crystal/refactor-event-processing branch from d4550ef to 47a2e3c Compare February 7, 2025 20:00
@clemire clemire enabled auto-merge (squash) February 8, 2025 03:01
@clemire clemire merged commit a6cc81c into main Feb 8, 2025
10 checks passed
@clemire clemire deleted the crystal/refactor-event-processing branch February 8, 2025 03:17
@clemire clemire restored the crystal/refactor-event-processing branch February 11, 2025 22:37
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.

2 participants