Page MenuHomePhabricator

[native] Expose GetDeviceListForUser RPC to JS
ClosedPublic

Authored by bartek on Jan 29 2024, 5:27 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Jun 25, 2:11 AM
Unknown Object (File)
Thu, Jun 20, 9:18 AM
Unknown Object (File)
Thu, Jun 13, 3:54 AM
Unknown Object (File)
May 25 2024, 10:47 PM
Unknown Object (File)
May 25 2024, 10:47 PM
Unknown Object (File)
May 25 2024, 10:46 PM
Unknown Object (File)
May 25 2024, 10:46 PM
Unknown Object (File)
May 23 2024, 5:34 AM
Subscribers

Details

Summary

Exposed GetDeviceListForUser RPC to JS via JSI.

Depends on D10862.

Test Plan

Called the method from JS, console.logged the result.

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

bartek held this revision as a draft.
bartek published this revision for review.Jan 29 2024, 7:11 AM
bartek added inline comments.
native/cpp/CommonCpp/NativeModules/CommRustModule.cpp
423

There's no easy Option support in C++ - Rust FFI so I decided to use 0 as a special value. All real device lists have timestamp greater than 0 so this doesn't matter

native/cpp/CommonCpp/NativeModules/CommRustModule.cpp
423

There is std::optional, but I suppose there is a good reason that doesn't work for us

This revision is now accepted and ready to land.Jan 31 2024, 2:55 AM
native/cpp/CommonCpp/NativeModules/CommRustModule.cpp
423

Yes, but there's no API to pass optionals from C++ to Rust.
We would have to do workarounds like 0-1 element vectors, but this would be an overkill for this particular purpose