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)
Fri, Nov 15, 3:23 AM
Unknown Object (File)
Thu, Nov 7, 2:01 AM
Unknown Object (File)
Fri, Nov 1, 11:17 PM
Unknown Object (File)
Oct 16 2024, 12:31 PM
Unknown Object (File)
Oct 16 2024, 7:51 AM
Unknown Object (File)
Oct 15 2024, 6:37 PM
Unknown Object (File)
Oct 15 2024, 6:36 PM
Unknown Object (File)
Oct 15 2024, 6:36 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