Page MenuHomePhabricator

Expose function to get notifs inbound keys to C++
ClosedPublic

Authored by marcin on Jul 15 2024, 4:48 AM.
Tags
None
Referenced Files
F2629760: D12748.id43083.diff
Sat, Sep 7, 1:45 PM
F2629726: D12748.id43141.diff
Sat, Sep 7, 1:44 PM
F2629725: D12748.id42735.diff
Sat, Sep 7, 1:44 PM
Unknown Object (File)
Thu, Sep 5, 11:09 PM
Unknown Object (File)
Wed, Sep 4, 2:17 PM
Unknown Object (File)
Sun, Sep 1, 10:11 AM
Unknown Object (File)
Sun, Sep 1, 4:32 AM
Unknown Object (File)
Fri, Aug 30, 1:23 PM
Subscribers

Details

Summary

This differential creates simple C++ class that calls platform-specific method to query for inbound keys. It is necessary have common race condition handling implementation in C++.

Test Plan

Call this function from CommCoreModule (e.x. place that gets called when updating draft) for some device ID taken from staging identity. Examine logs

Diff Detail

Repository
rCOMM Comm
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

native/android/app/src/main/java/app/comm/android/fbjni/NotificationsInboundKeysProvider.java
15 ↗(On Diff #42288)

Why return JSON with curve25519 only?

  1. We only need curve25519 to create inbound session.
  2. In next diff I will modify Session.cpp to use create_inbound_from instead of create_inbound. In Session.cpp there is a convention that we pass keys as JSON's and then add length of curve25519 or ed25519 string to advance pointer to the position where to key value begins.
  3. I could return the whole JSON but I am afraid that JSON after stringification might not preserve the order and put ed25519 before curve25519 which could lead to serious issues.
native/ios/Comm/NotificationsInboundKeysProvider.mm
22 ↗(On Diff #42288)

Explanation here is the same as for Android implementation.

kamil added inline comments.
native/android/app/src/main/java/app/comm/android/fbjni/NotificationsInboundKeysProvider.java
15 ↗(On Diff #42288)
  1. we should implement ENG-6429 one day
15 ↗(On Diff #42288)

could you add a code comment explaining this?

This revision is now accepted and ready to land.Jul 19 2024, 5:31 AM