Skip to content

[engine] WebSocket notification count #2592

Ben requested to merge feat/notif-count-sockets-e2592 into master

Ticket(s) / Related Merge Requests

Summary of Changes

Testing Considerations

Log in with 2 users, User A and User B. Feat flag: https://growthbook.minds.com/features/engine-2592-notification-count-sockets

Experiment ON
  • As User A, when sending a notification (e.g. via upvote) to the User B, their notification count increments.
  • When refreshing User B, the count is still there and only one call is made to get unread notifications.
  • On login with User A, only one call is made to unread notifications.
  • After logging out and logging into User B without refreshing, notification count is still updated when User A upvotes their content.
  • From User B's tab, after logging into a different user altogether, upvotes from User A to User B do NOT increment the count.
Experiment OFF
  • Polling continues as previously - a request is made every 60 seconds and the notification count is updated when that happens, if there is a new notification.

Note: upvoting, removing upvote, then upvoting again will trigger the count to increment by 1 every time - this is not related to this change and has always been like this.

Deployment Considerations

Needs to go to runners. Feat flag is here: https://growthbook.minds.com/features/engine-2592-notification-count-sockets

Regression Scope

Notification count updating.

Platform Affected (web, mobile, etc)

Web.

Developer Testing Completed

Manual, Unit (karma/jasmine/phpspec).

Screenshots / Screen Recording

Upvoting show
Upvoting increments count after relogging in & logging out and into a new user will update for that user.

simplescreenrecorder-2023-08-04_14.30.06

Count increments on upvote, reloading or logging into the same user again only calls to get read count once.

simplescreenrecorder-2023-08-04_14.28.58

Logging into a different user doesn't make you get the first users updates (no bleed between sessions)

simplescreenrecorder-2023-08-04_14.31.33

Experiment off polling

simplescreenrecorder-2023-08-04_14.42.51

Does this impact

  • Localization
  • Dark/light mode
  • Guest mode

Definition of Done Checklist

  • The Acceptance Criteria has been met
  • Code is tested: Testing includes unit/spec, E2E/automated and manual testing
  • Merge requests description has been filled out
Edited by Ben

Merge request reports