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
Unknown Object (File)
Tue, Oct 22, 1:16 PM
Unknown Object (File)
Tue, Oct 22, 9:08 AM
Unknown Object (File)
Tue, Oct 22, 8:33 AM
Unknown Object (File)
Tue, Oct 22, 8:33 AM
Unknown Object (File)
Tue, Oct 22, 8:33 AM
Unknown Object (File)
Tue, Oct 22, 8:33 AM
Unknown Object (File)
Sun, Oct 20, 9:36 PM
Unknown Object (File)
Sep 18 2024, 7:07 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
No Lint Coverage
Unit
No Test Coverage

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