Skip to content

Add address metadata APIs and a bridged sync engine to autofill - #7513

Open
DimiDL wants to merge 1 commit into
mozilla:mainfrom
DimiDL:autofill-address-meta-and-bridged-engine
Open

Add address metadata APIs and a bridged sync engine to autofill#7513
DimiDL wants to merge 1 commit into
mozilla:mainfrom
DimiDL:autofill-address-meta-and-bridged-engine

Conversation

@DimiDL

@DimiDL DimiDL commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Firefox Desktop is moving its address storage to this component and needs two things that are not currently exposed.

Storage APIs for importing records already persisted elsewhere - add_address_with_meta, add_many_addresses_with_meta, update_address_with_meta and add_many_address_tombstones - taking a caller-supplied guid, timestamps and change counter. The bulk variants run each record in a savepoint so one bad record neither aborts the migration nor leaves a row behind. Carrying the change counter means update_internal_address now takes a CounterUpdate of Increment, Leave or Set(i64).

A bridged sync engine, so Desktop's Sync framework can drive address sync: Store::addresses_bridged_engine() exposes the address engine the crate already has, which only implemented sync15::SyncEngine and so was unreachable from Desktop's mozIBridgedSyncEngine.

Nothing on mobile calls any of this; it is additive for the Desktop migration.

Pull Request checklist

  • Breaking changes: This PR follows our breaking change policy
    • This PR follows the breaking change policy:
      • This PR has no breaking API changes, or
      • There are corresponding PRs for our consumer applications that resolve the breaking changes and have been approved
  • Quality: This PR builds and tests run cleanly
    • Note:
      • For changes that need extra cross-platform testing, consider adding [ci full] to the PR title.
      • If this pull request includes a breaking change, consider cutting a new release after merging.
  • Tests: This PR includes thorough tests or an explanation of why it does not
  • Changelog: This PR includes a changelog entry in CHANGELOG.md or an explanation of why it does not need one
    • Any breaking changes to Swift or Kotlin binding APIs are noted explicitly
  • Dependencies: This PR follows our dependency management guidelines
    • Any new dependencies are accompanied by a summary of the due diligence applied in selecting them.

Firefox Desktop is moving its address storage to this component and needs two
things that are not currently exposed.

Storage APIs for importing records already persisted elsewhere -
add_address_with_meta, add_many_addresses_with_meta, update_address_with_meta
and add_many_address_tombstones - taking a caller-supplied guid, timestamps and
change counter. The bulk variants run each record in a savepoint so one bad
record neither aborts the migration nor leaves a row behind. Carrying the change
counter means update_internal_address now takes a CounterUpdate of Increment,
Leave or Set(i64).

A bridged sync engine, so Desktop's Sync framework can drive address sync:
Store::addresses_bridged_engine() exposes the address engine the crate already
has, which only implemented sync15::SyncEngine and so was unreachable from
Desktop's mozIBridgedSyncEngine.

Nothing on mobile calls any of this; it is additive for the Desktop migration.
@DimiDL
DimiDL force-pushed the autofill-address-meta-and-bridged-engine branch from d3d44c2 to 4cf1cf6 Compare July 31, 2026 13:24

@jo jo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good, I esp. like with_savepoint.

I think we could go without support for sync_change_counter update via AddressMeta because when this is used during import (where I think it is designed for) the local mirror will be always empty and the record is transferred anyway.

Note that this will race with #7483 which greatly simplifies the sync bridge code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants