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

Make browser notifications works for all space #23

Open
bonustrack opened this issue Aug 9, 2022 · 5 comments
Open

Make browser notifications works for all space #23

bonustrack opened this issue Aug 9, 2022 · 5 comments
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@bonustrack
Copy link
Member

bonustrack commented Aug 9, 2022

Instead of having to subscribe for space one by one, we should change the browser notification system so you get notified for all space you follow. First step is to do specs on how to do that change.

@bonustrack
Copy link
Member Author

We need first to make it possible on the UI to enable or disable browser notifications

@samuveth samuveth added the enhancement New feature or request label Aug 16, 2022
@samuveth
Copy link

I've added a design task for concepted for the toggle inside the notifications dropdown.

Next step will be figuring out the mechanic for subscribing to all spaces and automatically subscribing when new spaces are followed.

@bonustrack
Copy link
Member Author

This is the current implementation:

In the frontend: https://github.com/snapshot-labs/snapshot/blob/develop/src/composables/useSpaceSubscription.ts#L65-L66
The function that send notifications: https://github.com/snapshot-labs/snapshot-webhook/blob/master/src/helpers/beams.ts

Currently we use Pusher.com "Beam" solution to manage notifications, with Beam you can create a "topic" and send notifications for everyone who subscribed to that topic, the issue with topic is that an user can only subscribe to a topic by doing a request in our frontend, we can't subscribe an user to different topics without the user. If an user join the space Uniswap with his desktop browser we can subscribe him to the space notification and use the space id "uniswap" as topic, but if user leave a space with his mobile phone we are not able to unsubscribe him to "uniswap" notifications cuz device changed. This is the reason that we've been using wallet address as topic in our current implementation, this allow us to send notifications to the users when we know an event for a space they subscribed to occur. But topic shouldn't be used for that, there is a limit of 100 topic event you can publish in a request see https://github.com/snapshot-labs/snapshot-webhook/blob/master/src/helpers/beams.ts#L32 this doesn't scale

I would recommend check again if there is a way we can make it work with Pusher, otherwise we can explore https://firebase.google.com , this solution might help too: https://novu.co/

@samuveth samuveth added the help wanted Extra attention is needed label Aug 25, 2022
@bonustrack
Copy link
Member Author

WIP by @eswarasai

@zzuziak
Copy link

zzuziak commented Jan 30, 2023

Hey @eswarasai, what's the status on this issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants