alakajam-team / alakajam

Website powering the Alakajam! game making community
https://alakajam.com/
Other
29 stars 13 forks source link

Follow User to Receive Upload Notifications #392

Closed SmBe19 closed 3 years ago

SmBe19 commented 5 years ago

It would be nice to be able to follow a user. If this user then submits a game or a post I get a notification. This would allow to play the games of a user you enjoyed in previous jams more easily.

mkalam-alami commented 5 years ago

Technical notes

Currently we're using "pull" notifications rather than "push", ie. it's upon loading a page on Alakajam that we look for notifications to present (and cache them for performance reasons, unless certain actions like a comment explicitly invalidate the cache). I'm still undecided whether it's something we should change to actually have a notification table of sorts that gets populated with new lines every time something we're subscribed to happens.

Anyway, if we stick to the current approach, we could use the fact that post & game notifications don't need to be as instantaneous as for comments:

  1. Posts notifications = All posts created after the user.notifications_last_read time for which we're subscribed to the author.
  2. Event notifications = All games created after the user.notifications_last_read time for which we're subscribed to the author. Maybe filter out events based on event.updated_at > user.notifications_last_read for additional optimization (that means notifications will be received only when game submissions are closed).
  3. Caching = Remains global for all notifications. Keep invalidating the cache when new notified comments arrive, but don't bother invalidating caches when posts/games are created. The cache TTL is currently set to 10mn, it can probably stay that way for now as the 2 new queries won't be expensive.

Additional work will be:

mkalam-alami commented 3 years ago

Moved to the Feature requests page for now.