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)
Apr 8 2024, 10:24 PM
Unknown Object (File)
Apr 8 2024, 2:32 PM
Unknown Object (File)
Apr 6 2024, 6:58 AM
Unknown Object (File)
Apr 4 2024, 7:01 PM
Unknown Object (File)
Apr 4 2024, 7:01 PM
Unknown Object (File)
Apr 4 2024, 7:01 PM
Unknown Object (File)
Apr 1 2024, 4:43 AM
Unknown Object (File)
Mar 29 2024, 10:50 PM
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
Lint Not Applicable
Unit
Tests Not Applicable

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