Page MenuHomePhabricator

Move notification creaction and encryption to lib except for APNs noifs.
ClosedPublic

Authored by marcin on Jun 11 2024, 10:39 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Sep 15, 12:00 PM
Unknown Object (File)
Wed, Sep 11, 11:11 PM
Unknown Object (File)
Wed, Sep 11, 7:32 AM
Unknown Object (File)
Mon, Sep 9, 2:05 PM
Unknown Object (File)
Mon, Sep 9, 7:26 AM
Unknown Object (File)
Mon, Sep 9, 5:14 AM
Unknown Object (File)
Wed, Sep 4, 11:42 PM
Unknown Object (File)
Tue, Sep 3, 11:38 PM
Subscribers

Details

Summary

This differential uses EncryptedNotifsUtilsAPI to move notif generation and encryption to lib. APNs notifs are exception since in this case we will need to implement new types, creation and encryption from scratch instead of just smart copy-paste. It will be handled in separate diff.

Test Plan
  1. Flow
  2. Test all notifs for all platform and large notifs as well.

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

kamil requested changes to this revision.Jun 19 2024, 3:29 PM

Looks good but want to see responses to the inline comments before accepting.

keyserver/src/push/send.js
419

could you explain why not dbID?

lib/push/notif-creators.js
1

This file is messy a bit, what do you think about slicing code here and moving code to specific files for each platform to make it a bit more readable? I am not a fan of creating huge files with multiple purposes but if you have a different opinion I am okay with it.

Something like lib/push/android-notif-creators.js, lib/push/web-notif-creators.js etc.

31

nit: maybe worth now moving those to a separate file with constants?

252

I think this prop was added. Could you annotate all changes made additionally to moving code from /keyserver to /lib? Without annotating this, this diff is really hard to review

This revision now requires changes to proceed.Jun 19 2024, 3:29 PM

Split notif creators for each platform to separate files.

keyserver/src/push/send.js
419

This function will be used on the client where we decided to cut scope and skip notif persistence. Therefore dbID doesn't make sense in general context.

lib/push/android-notif-creators.js
3 ↗(On Diff #41554)

Consider this logic a copy paste from the keyserver

lib/push/web-notif-creators.js
3 ↗(On Diff #41554)

Consider this logic a copy paste from the kesyerver. I only made it responsibility of the sender to create the id and pass it to function instead of generating it inside a function.

lib/push/wns-notif-creators.js
1 ↗(On Diff #41554)

Consider this a copy paste from the keyserver.

Thanks!

lib/types/notif-types.js
83 ↗(On Diff #41554)

why this change?

This revision is now accepted and ready to land.Jun 21 2024, 1:31 AM
lib/types/notif-types.js
83 ↗(On Diff #41554)

For thick threads we don't include the badge count in the notif since we don't know the badge count of the client we send notif to. It will be the responsibility of the client to calculate the badge count.

Add type of encrypted message to encrypted notification (1 for text and 0 for prekey)