Page MenuHomePhabricator

Add keyserverID to Android and iOS notification payload.
ClosedPublic

Authored by marcin on Mar 4 2024, 5:28 AM.
Tags
None
Referenced Files
F3383946: D11235.diff
Thu, Nov 28, 6:29 PM
F3383818: D11235.id37770.diff
Thu, Nov 28, 5:55 PM
Unknown Object (File)
Wed, Nov 27, 2:26 AM
Unknown Object (File)
Mon, Nov 25, 5:45 AM
Unknown Object (File)
Mon, Nov 25, 5:36 AM
Unknown Object (File)
Thu, Nov 14, 10:52 AM
Unknown Object (File)
Tue, Nov 12, 11:22 AM
Unknown Object (File)
Thu, Nov 7, 1:43 AM
Subscribers

Details

Summary

This updates keyserver code so that it inserts its unencrypted id in notification payload.

Test Plan

Build iOS/Android app. Ensure that notifications and unread count work correctly.

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

Harbormaster returned this revision to the author for changes because remote builds failed.Mar 4 2024, 5:40 AM
Harbormaster failed remote builds in B27293: Diff 37770!

Restructure stack to separate multiple unread count from multiple sessions

keyserver/src/push/types.js
50 ↗(On Diff #37789)

Didn't know this syntax was possible. To be honest, I'm a little skeptical that Flow will be able to understand it, and I suspect that it is breaking the types but not reporting it. Might be good to do some inspection via IDE or flow type-at-pos

This differential removes ashoatKeyserverID from native notifs code

There are only keyserver changes, was something not included?

keyserver/src/push/rescind.js
65 ↗(On Diff #37789)

Why was this removed?

This differential removes ashoatKeyserverID from native notifs code

There are only keyserver changes, was something not included?

Initially this diffs contained native changes. I restructured my stack so that they are not there anymore but forgot to update diff description.

keyserver/src/push/rescind.js
65 ↗(On Diff #37789)

Clearly my mistake - will fix it.

keyserver/src/push/types.js
50 ↗(On Diff #37789)

Inspection with IDE reveals the following structure:

type AndroidNotificationRescind = {
  +data: {
    +keyserverID: string,
    ...(
      {
        +badge: string,
        +encryptionFailed?: string,
        +rescind: "true",
        +rescindID: string,
        +setUnreadStatus: "true",
        +threadID: string
      }
      |
      {+encryptedPayload: string})
  }
}
= {
  +data: (
    {encryptedPayload: string, keyserverID: string}
    |
    {
      badge: string,
      encryptionFailed?: string,
      keyserverID: string,
      rescind: "true",
      rescindID: string,
      setUnreadStatus: "true",
      threadID: string
    })
}

I guess then that flow follows A and (B or C) = (A and B) or (A and C). In other words it understands it as a union of types following the spread operator each of which was enriched with keyserverID. It is what we want here.

Fix accidentally removed SQL line

marcin edited the summary of this revision. (Show Details)
This revision is now accepted and ready to land.Mar 7 2024, 2:49 AM