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)
Wed, Nov 20, 3:41 AM
Unknown Object (File)
Wed, Nov 20, 2:44 AM
Unknown Object (File)
Tue, Nov 12, 4:37 PM
Unknown Object (File)
Tue, Nov 5, 3:55 PM
Unknown Object (File)
Sun, Nov 3, 4:31 AM
Unknown Object (File)
Oct 22 2024, 1:16 PM
Unknown Object (File)
Oct 22 2024, 9:08 AM
Unknown Object (File)
Oct 22 2024, 8:33 AM
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