HomePhabricator
Diffusion Comm 34449495726c

[native] make generateNonce callable from js

Description

[native] make generateNonce callable from js

Summary:
rust: add generate_nonce to the cxx bridge. in the fn implementation we construct
a client to talk to the identity service, and then call the generate_nonce RPC.

if we get an error constructing the client or calling the RPC, we convert it to
a string call stringCallback with it. otherwise we call the callback with the
nonce.

c++: implement generateNonce in CommCoreModule, which just calls the Rust fn
exposed by CXX with an atomically incremented promise ID

js: codegen some JSI functions

Test Plan: see gist: https://gist.github.com/vdhanan/bc034bf2e099b969724d25e04e77ba3b

Reviewers: ashoat, jon

Reviewed By: ashoat, jon

Subscribers: tomek, atul

Differential Revision: https://phab.comm.dev/D7215

Details

Provenance
varunAuthored on Mar 28 2023, 11:56 AM
Reviewer
ashoat
Differential Revision
D7215: [native] make generateNonce callable from js
Parents
rCOMM3a6124060767: [native] more one-time setup for rust-C++ integration
Branches
Unknown
Tags
Unknown