Closed Innders closed 1 month ago
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.
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).
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)
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.
Story
I'm on a different website doing stuff and I want to know when a new message comes into AYON.
Problems
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.