Page MenuHomePhabricator

[lib] Implement sending WebPush notifs using Tunnelbroker
ClosedPublic

Authored by bartek on Jul 26 2024, 6:30 AM.
Tags
None
Referenced Files
F4945068: D12897.diff
Tue, Mar 18, 11:35 PM
Unknown Object (File)
Fri, Mar 14, 1:01 PM
Unknown Object (File)
Tue, Mar 11, 11:49 AM
Unknown Object (File)
Tue, Mar 4, 11:41 PM
Unknown Object (File)
Mon, Mar 3, 6:24 AM
Unknown Object (File)
Mon, Mar 3, 6:24 AM
Unknown Object (File)
Mon, Mar 3, 6:24 AM
Unknown Object (File)
Fri, Feb 28, 6:06 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