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

[Notifications] Investigate adding follows as a notification to the notifications service #85

Open
setch-l opened this issue Mar 26, 2024 · 1 comment
Assignees

Comments

@setch-l
Copy link

setch-l commented Mar 26, 2024

Per our infra conversation from last week:

  • investigate adding follows to the Notification service
  • As part of this work evaluate the Notification service to see if we should keep it as is or replace it.
  • Include findings in comments on this ticket (ping Linda)
@dcadenas
Copy link
Contributor

Our Events service has the necessary information, but we currently do not utilize it. To implement new follower notifications, we need to establish communication between the Events service and the Notifications service. The required changes are as follows:

  1. Calculate a diff each time follower data is updated through kind 3 updates. This will allow us to detect if new npubs are added (we can also detect removals for completeness, even if we don’t consume this information for now).
  2. Store the latest version of the kind 3 update in the database to minimize the possibility of race condition issues, as described in this GitHub comment.
  3. Communicate each added npub to the Notifications service. Currently, there is no communication between these services. They share a common queue but act as publishers, with the only consumer being the moderation service, Cleanstr. Each service downloads events from relays, so we can leverage the existing architecture. We will modify the Events service to publish added followers through an event of kind 30382, as described in NIP-81. This also enriches the network’s knowledge and benefits other clients and use cases.
  4. Update the Notifications service to consume these kind 30382 events and extend its current functionality, which detects mentions in kind 1 events.
  5. Implement any necessary cascading updates until the notification is rendered.
  6. I’ll need assistance from an iOS developer to set up a local environment to see push notifications on my phone or simulator. I’m currently experiencing Apple Developer ID issues, and the instructions in the Notifications service readme didn’t resolve them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Code Review
Development

No branches or pull requests

2 participants