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: When a new inbox item is available send to user over WS #222

Closed
Innders opened this issue Jun 4, 2024 · 4 comments · Fixed by #226
Closed

Notifications: When a new inbox item is available send to user over WS #222

Innders opened this issue Jun 4, 2024 · 4 comments · Fixed by #226
Assignees
Labels
type: feature Adding something new and exciting to the product

Comments

@Innders
Copy link
Member

Innders commented Jun 4, 2024

Story

I'm on a different website doing stuff and I want to know when a new message comes into AYON.

Problems

  • A crude graphql endpoint is called on location.pathname or after 10 minutes. This doesn't work when not focused on the tab.

Proposal

Fire a WS event when a new inbox item is available. It doesn't need to contain the full message but maybe just a summary and a current unread count.

@Innders Innders added the type: feature Adding something new and exciting to the product label Jun 4, 2024
@martastain
Copy link
Member

Would it be okay if the message is "fire and forget"? When a user is online (WS connection is active) and new user reference is created, it would send that message, but if he connect later, the message would be lost?

In that case I could just create a handler that would intercept all new user references and send them. Otherwise, state management would be quite painful.

@BigRoy
Copy link
Contributor

BigRoy commented Jun 5, 2024

Would it be okay if the message is "fire and forget"? When a user is online (WS connection is active) and new user reference is created, it would send that message, but if he connect later, the message would be lost?

I'd say so, yes. Notifications would be like being active in a chatbox, you'll only get those when in there - you won't get notifications for all the chat history that's happened before you entered. It's kind of like having Discord or Slack open or not. You only get notifications when you have the app open (they do have the ability to mute however).

@martastain
Copy link
Member

Mute? Who would mute that cool notification sound I've made? :-)

Okay, that should be doable. And on page load, the frontend would just check for existing unread messages using the API (GraphQL now and eventually using a dedicated REST endpoint)

@BigRoy
Copy link
Contributor

BigRoy commented Jun 5, 2024

And on page load, the frontend would just check for existing unread messages using the API

Yup, and even then I wouldn't expect that to turn into a notification actually.

@martastain martastain linked a pull request Jun 6, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature Adding something new and exciting to the product
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants