Page MenuHomePhabricator

[keyserver/web/desktop] Add macos and windows as platforms
ClosedPublic

Authored by michal on Feb 24 2023, 9:28 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Mar 15, 9:52 AM
Unknown Object (File)
Thu, Mar 7, 2:03 PM
Unknown Object (File)
Thu, Mar 7, 11:49 AM
Unknown Object (File)
Feb 21 2024, 2:20 PM
Unknown Object (File)
Feb 21 2024, 9:14 AM
Unknown Object (File)
Feb 21 2024, 9:14 AM
Unknown Object (File)
Feb 21 2024, 9:14 AM
Unknown Object (File)
Feb 20 2024, 12:07 AM
Subscribers

Details

Summary

We want to support desktop device types to be able to handle native notifications. This diff adds macos and windows to the possible platform and sets config on the web app depending on where it's running. Older desktop clients with newer web app will still be treated as web. Additionaly if on the socket initialization we detect that someone has a user agent with "Electron" and still has device token of web we will ask the web app to send us the current device type, so already logged in users will be updated.

Test Plan
  • check that after login the device type is macos
  • check that for already logged in users the device type changes to macos and remains that after logging out on the anoonymous cookie

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

ashoat added inline comments.
keyserver/src/socket/socket.js
460 ↗(On Diff #23066)

I might be wrong, but I think if viewer.userAgent is not set, you'll need optional chaining on the function invocation as well

This revision is now accepted and ready to land.Feb 26 2023, 4:38 AM
keyserver/src/socket/socket.js
460 ↗(On Diff #23066)

I tested it and it seems that if viewer.userAgent isn't set the call expression will evaluate to undefined. Flow also types it as void | boolean

keyserver/src/socket/socket.js
460 ↗(On Diff #23066)

Thanks for checking!