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

Track notifications by ID #16

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

micahmo
Copy link
Member

@micahmo micahmo commented Jun 24, 2024

This PR updates the notification server to use IDs rather than timestamps when determining which notifications to process. This relies on the fact that local IDs are always incrementing. This should solve at least two problems with missing notifications.

  • Notifications may be missing due to a race condition, where a notification arrives after we have done the processing but before we have updated the timestamp.
  • Notifications may be missing due to federation issues, where a notification with an old publication date does not get federated until sometime later (fortunately, in this case, the ID is still incremented on the local instance).

Eventually we should probably make a similar change in Thunder for local notifications, but I think it's less of an issue (seems to be more related to the federation case than the race condition case).

@micahmo micahmo requested a review from hjiangsu June 24, 2024 13:26
Copy link
Member

@hjiangsu hjiangsu left a comment

Choose a reason for hiding this comment

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

Just some slight comments, otherwise LGTM!

src/notifications/service/notification_service.ts Outdated Show resolved Hide resolved
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