Page MenuHomePhabricator

[web] Only update badge when connected
ClosedPublic

Authored by michal on Apr 6 2023, 7:32 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Jun 17, 2:16 AM
Unknown Object (File)
Mon, Jun 17, 12:21 AM
Unknown Object (File)
Wed, Jun 12, 6:03 PM
Unknown Object (File)
Fri, May 31, 7:34 PM
Unknown Object (File)
Wed, May 29, 6:41 AM
Unknown Object (File)
Wed, May 29, 6:41 AM
Unknown Object (File)
Wed, May 29, 6:41 AM
Unknown Object (File)
Wed, May 29, 6:41 AM
Subscribers

Details

Summary

Part of ENG-3350.
Changed the tab title/ icon badge logic on web to update only when websocket is connected (otherwise the unreadCound could be outdated). Additionaly we update the badge immediately when connecting to the websocket. The logic is identical to the one on native (native/push/push-handler.react.js:226-232);

Depends on D7327

Test Plan

Open the web app in the browser and in the desktop app (without notifs). Check if sending a message updated the tab title (browser)/ badge (desktop), and reading it removes them.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

michal requested review of this revision.Apr 6 2023, 7:54 AM
ashoat added inline comments.
web/push-notif/badge-handler.react.js
13 ↗(On Diff #24731)

I actually think we should initialize this to undefined. That way, on the first run if connection.status === 'connected', it will update the badge count

This revision is now accepted and ready to land.Apr 6 2023, 11:06 AM

Init prevConnection to undefined