Closed Bug 1634191 Opened 4 years ago Closed 4 years ago

Wire up the Golden Gate Sync bridge to Rust extension storage

Categories

(WebExtensions :: Storage, task, P1)

task

Tracking

(firefox78 fixed)

RESOLVED FIXED
mozilla78
Tracking Status
firefox78 --- fixed

People

(Reporter: lina, Assigned: lina)

References

()

Details

(Whiteboard: SACI)

Attachments

(2 files)

Now that we've vendored webext_storage and have a shiny XPCOM component for our new Rust extension storage area, let's make it implement mozIBridgedSyncEngine, and wire up its methods to call into the BridgedSyncEngine on the Rust side. This depends on getting Mark's sync infrastructure patch landed on the a-s side, and bumping our vendored version to pick up those changes.

While we're here, we can also add a JS Sync engine for the new Rust extension storage.

Summary: Wire up thee Golden Gate Sync bridge to Rust extension storage → Wire up the Golden Gate Sync bridge to Rust extension storage
Priority: -- → P1
Whiteboard: SACI
Blocks: 1623245
Depends on: 1634626

This commit adds syncing support to the StorageSyncArea class, via
the Golden Gate library.

I haven't done the JS side of this yet (adding a class ExtensionStorageEngine extends BridgedEngine), and it's going to need some changes to the JS code so that we can pass modified and deleted through on the JSON records—but I wanted to get the Rust side up for review! I'll finish off the JS tomorrow, and maybe by then we'll have landed https://github.com/mozilla/application-services/pull/2892 and https://github.com/mozilla/application-services/pull/3064, and we can vendor everything in one go and have a full syncing implementation working! 🎉

We could even do the JS side later, if we want...but then we'd have to make another intermediate bug blocking 1634615. 😁

This commit splits CryptoWrapper into a base RawCryptoWrapper
class, which only handles encryption and decryption without
parsing the cleartext's contents, and the existing CryptoWrapper
class, which works like before.

Our bridged engine subclasses RawCryptoWrapper, and
implements some methods to convert records to and from envelopes.
Envelopes are a concept we introduced in sync15_traits to pass
along metadata from the BSO wrapper (like the modified time from the
server, and ID, to ensure they match) in addition to the cleartext.
This lets us reuse sync15_traits::Payload to parse record payloads
in Rust, and avoids parsing the cleartext in JS, only to stringify it
again when we pass it to the bridged Rust engine.

adding a class ExtensionStorageEngine extends BridgedEngine)

I still haven't done this...

and it's going to need some changes to the JS code so that we can pass modified and deleted through on the JSON records.

But I did that. The a-s side is in https://github.com/mozilla/application-services/pull/3067. It's a little complicated (of course! 😂😭) because I wanted to reuse the existing Payload type in sync15_traits for the cleartext, and pass the metadata fields in a wrapper in a more generic way.

Keywords: leave-open
Pushed by kcambridge@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/427d247d7c2f
Pass BSO fields along with Sync record payloads to bridged Rust engines. r=markh
Regressions: 1635312
Keywords: leave-open
Blocks: 1635352
No longer blocks: 1628752, 1634615
Pushed by kcambridge@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/aec4fe84eabf
Wire up Golden Gate to the new Rust extension storage interface. r=markh
Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla78
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: