shuttlecraft icon indicating copy to clipboard operation
shuttlecraft copied to clipboard

Instant notifications

Open ringtailsoftware opened this issue 2 years ago • 6 comments

Added an eventemitter to notify /poll that a notification has occurred. /poll now stalls forever waiting for an event (once an event occurs, app.js repolls after 1s) Adding a notification sends the event

ringtailsoftware avatar Dec 22 '22 09:12 ringtailsoftware

Rad. This is rad. Thanks.

benbrown avatar Dec 22 '22 16:12 benbrown

I am testing this right now and it is mind boggling how fast it is. I will have to implement this for the DM interface too ;p

benbrown avatar Dec 22 '22 20:12 benbrown

ah, one small bug - if there are unread messages already waiting, they won't show up til the first new incoming. the first request should always return current status.

benbrown avatar Dec 22 '22 20:12 benbrown

Also, not sure the impact of this - but the server-side listener continues to exist even if i navigate away from the page.

benbrown avatar Dec 22 '22 20:12 benbrown

I think that fixes both issues

ringtailsoftware avatar Dec 22 '22 21:12 ringtailsoftware

The last few commits on here raise eyebrows - I don't really want to fire notifications for every single incoming post or dm. This will create a lot of noise in the notifications that has to be filtered out.

Instead, you could directly trigger the "check for notifications" event from those places, which would cause the longpoll to do the actual calculations...

benbrown avatar Dec 27 '22 16:12 benbrown