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
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
Unknown Object (File)
Wed, Nov 6, 2:48 PM
Unknown Object (File)
Sun, Nov 3, 9:25 AM
Unknown Object (File)
Wed, Oct 30, 2:34 PM
Unknown Object (File)
Oct 22 2024, 8:39 AM
Unknown Object (File)
Oct 22 2024, 4:08 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