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)
Fri, Nov 8, 9:58 AM
Unknown Object (File)
Tue, Nov 5, 10:04 PM
Unknown Object (File)
Tue, Nov 5, 10:04 PM
Unknown Object (File)
Tue, Nov 5, 10:04 PM
Unknown Object (File)
Tue, Nov 5, 2:28 AM
Unknown Object (File)
Mon, Nov 4, 8:31 AM
Unknown Object (File)
Thu, Oct 31, 11:19 PM
Unknown Object (File)
Thu, Oct 31, 11:19 PM
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
No Lint Coverage
Unit
No Test Coverage

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