Page MenuHomePhabricator

[lib] Implement sending WebPush notifs using Tunnelbroker
ClosedPublic

Authored by bartek on Jul 26 2024, 6:30 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Sep 25, 5:16 PM
Unknown Object (File)
Wed, Sep 25, 5:15 PM
Unknown Object (File)
Wed, Sep 25, 5:13 PM
Unknown Object (File)
Sep 16 2024, 1:23 PM
Unknown Object (File)
Sep 7 2024, 1:41 PM
Unknown Object (File)
Sep 7 2024, 1:41 PM
Unknown Object (File)
Sep 6 2024, 4:08 AM
Unknown Object (File)
Sep 5 2024, 9:55 AM
Subscribers

Details

Summary

Client code to send notif - only updating types to allow this.
Added a more general TunnelbrokerNotif union type to avoid extending unions in the callsites.

Depends on D12896

Test Plan

Tested together with @kamil, using the following code:

const notif: PlainTextWebNotification = {
  id: uuid.v4(),
  body: 'body hello',
  title: 'notif from TB',
  threadID: '123',
};
const tbNotif: TunnelbrokerWebPushNotif = {
  type: 'WebPushNotif',
    clientMessageID: uuid.v4(),
    deviceID: '*******************************************',
    payload: JSON.stringify(notif),
};
try {
  console.log('starting');
  await sendNotif(tbNotif);
  console.log('done');
} catch (e) {
  console.log(e);
}

Successfully received notif on Firefox, Chrome and Safari

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage