Page MenuHomePhabricator

[web] Create a function that reassigns notifs session
ClosedPublic

Authored by tomek on Fri, Apr 12, 11:13 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Apr 27, 2:28 AM
Unknown Object (File)
Fri, Apr 26, 11:22 AM
Unknown Object (File)
Mon, Apr 22, 1:50 AM
Unknown Object (File)
Sun, Apr 21, 1:11 AM
Unknown Object (File)
Fri, Apr 19, 2:39 PM
Unknown Object (File)
Thu, Apr 18, 9:05 PM
Unknown Object (File)
Wed, Apr 17, 3:14 PM
Unknown Object (File)
Wed, Apr 17, 7:34 AM
Subscribers

Details

Summary

This function determines where a session were stored, where it should be placed, and moves it from one to another.

https://linear.app/comm/issue/ENG-7688/introduce-a-function-that-moves-a-notifs-session

Depends on D11647

Test Plan

Tested in combination with the next diff: open the web app, login, send a message from another client - a notif should be displayed (without this stack we can only see a notif with a warning message). Also, verify that the reassignment actually occurs by adding some console logs.

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

marcin added inline comments.
web/shared-worker/worker/worker-crypto.js
368 ↗(On Diff #39082)

Those two promises look like they could run simultaneously. However if the app crashes while those two promises run in parallel we might not be able to recover from it and retry item reassignment but if we separate those two steps we can retry item reassignment. Do I understand correctly that keeping those promises sequential was intentional?

This revision is now accepted and ready to land.Mon, Apr 15, 12:26 AM

Rebase

web/shared-worker/worker/worker-crypto.js
368 ↗(On Diff #39082)

Yes, it is safer to first set and then delete. But I'm not sure if we can recover from this currently - we probably would need to introduce some retry logic.