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)
Sat, Dec 7, 8:35 PM
Unknown Object (File)
Thu, Dec 5, 8:22 PM
Unknown Object (File)
Thu, Dec 5, 8:22 PM
Unknown Object (File)
Thu, Dec 5, 8:22 PM
Unknown Object (File)
Wed, Dec 4, 3:39 AM
Unknown Object (File)
Nov 16 2024, 12:12 PM
Unknown Object (File)
Nov 8 2024, 9:58 AM
Unknown Object (File)
Nov 5 2024, 10:04 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