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)
Thu, Jun 13, 3:54 AM
Unknown Object (File)
Sat, May 25, 10:47 PM
Unknown Object (File)
Sat, May 25, 10:47 PM
Unknown Object (File)
Sat, May 25, 10:46 PM
Unknown Object (File)
Sat, May 25, 10:46 PM
Unknown Object (File)
Thu, May 23, 5:34 AM
Unknown Object (File)
Apr 25 2024, 1:13 PM
Unknown Object (File)
Apr 25 2024, 1:13 PM
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
Lint Not Applicable
Unit
Tests Not Applicable

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 ↗(On Diff #36259)

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 ↗(On Diff #36259)

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 ↗(On Diff #36259)

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