Page MenuHomePhabricator

[web] add std::optional (C++) <-> undefined (JS) marshalling
ClosedPublic

Authored by ashoat on Jul 14 2024, 6:06 PM.
Tags
None
Referenced Files
F3524473: D12736.id42365.diff
Mon, Dec 23, 12:40 PM
F3524471: D12736.id42269.diff
Mon, Dec 23, 12:40 PM
F3524427: D12736.id.diff
Mon, Dec 23, 12:40 PM
F3524407: D12736.diff
Mon, Dec 23, 12:39 PM
Unknown Object (File)
Sun, Dec 15, 1:32 AM
Unknown Object (File)
Wed, Nov 27, 7:53 PM
Unknown Object (File)
Mon, Nov 25, 7:36 AM
Unknown Object (File)
Mon, Nov 25, 6:17 AM
Subscribers
None

Details

Summary

This follows a similar approach outlined in D8552. I was inspired by searching the string "BindingType<std::optional" on GitHub. This project provided a good implementation.

Depends on D12735

Test Plan

I tested this as part of the getLatestMessageEdit API I introduce later in this stack. I tested that on both web and iOS, which required using the std::optional <-> undefined marshalling

Diff Detail

Repository
rCOMM Comm
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

It's great to see these bindings! At some point, we should delete NullableString and NullableInt.

The diff looks reasonable but @kamil should also take a look.

This revision is now accepted and ready to land.Jul 15 2024, 1:46 AM

Making @kamil blocking based on @tomek's comment above.

It's great to see these bindings! At some point, we should delete NullableString and NullableInt.

We should also be able to get rid of the web-specific getOlmPersistAccountDataWeb and just use getOlmPersistAccountData on web. I'll create a follow-up task for this before landing.

This revision now requires review to proceed.Jul 15 2024, 8:07 AM

I ended up not needing this, since I'm replacing the getLatestMessageEdit API with a getRelatedMessages API that returns an array.

That said, I think it's still work landing. Going to separate it out from the rest of my stack though.

This revision is now accepted and ready to land.Jul 16 2024, 2:55 AM

We should also be able to get rid of the web-specific getOlmPersistAccountDataWeb and just use getOlmPersistAccountData on web. I'll create a follow-up task for this before landing.

Task with some context: ENG-5719.

Ah okay, no need to create a new follow-up task then – thanks for linking!