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
F3339776: D12736.id42365.diff
Thu, Nov 21, 8:38 PM
Unknown Object (File)
Wed, Nov 20, 2:26 PM
Unknown Object (File)
Wed, Nov 20, 2:26 PM
Unknown Object (File)
Wed, Nov 20, 2:25 PM
Unknown Object (File)
Wed, Nov 20, 2:25 PM
Unknown Object (File)
Mon, Nov 18, 6:44 PM
Unknown Object (File)
Sun, Nov 17, 4:38 PM
Unknown Object (File)
Sat, Nov 9, 9:00 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!