Skip to content

Bug 2049279 - Add passport record type to autofill#7440

Merged
jo merged 1 commit into
mozilla:mainfrom
DimiDL:passport-autofill
Jun 23, 2026
Merged

Bug 2049279 - Add passport record type to autofill#7440
jo merged 1 commit into
mozilla:mainfrom
DimiDL:passport-autofill

Conversation

@DimiDL

@DimiDL DimiDL commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Add a passport autofill record type (name, country, passport number, and issue/expiry dates) with full CRUD, modeled on the existing addresses type.

The schema is laid out sync-ready: passports_data carries a sync_change_counter alongside passports_mirror / passports_tombstones and the sync staging tables, so a sync engine can be added later without a schema migration. No sync engine is registered yet, so passports are not synced. Fields follow the autofill convention - stored as plaintext, with empty/0 meaning "not provided".

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.

@mhammond mhammond left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This looks like I expected it to :)

Comment thread components/autofill/src/db/schema.rs Outdated
}

fn upgrade_from_v4(db: &Connection) -> Result<()> {
let migration_string: &str = include_str!("../../sql/migrations/v5_migration.sql");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Do we need this migration, or can we just re-execute create_shared_schema? That would avoid needing the test for them drifting too. I'm not sure why the others weren't done that way, but that's the approach most other components use

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Nice catch, thanks! I updated the patch!

CREATE TABLE IF NOT EXISTS passports_tombstones (
guid TEXT PRIMARY KEY CHECK(length(guid) != 0),
time_deleted INTEGER NOT NULL
) WITHOUT ROWID;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

you don't have the shared triggers for this yet. That seems fine I guess until you sync though.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'd defer the shared triggers until implementing sync, to keep this patch simpler. I'm keeping the tombstones table in this patch so we don't need a migration when sync is implemented.

sync_change_counter INTEGER NOT NULL
);

DROP TABLE IF EXISTS passports_sync_staging;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

because these are temp tables you don't actually need them yet - they can be added later without needing a migration. I guess there's no harm adding them though, but also no real benefit.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ok, removed

Add a passport autofill record type (name, country, passport number, and
issue/expiry dates) with full CRUD, modeled on the existing addresses type.

The schema is laid out sync-ready: passports_data carries a
sync_change_counter alongside passports_mirror / passports_tombstones and
the sync staging tables, so a sync engine can be added later without a
schema migration. No sync engine is registered yet, so passports are not
synced. Fields follow the autofill convention - stored as plaintext, with
empty/0 meaning "not provided".
@DimiDL DimiDL force-pushed the passport-autofill branch from 1b11b30 to 731f21b Compare June 23, 2026 12:08

@mhammond mhammond left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👍

@jo jo added this pull request to the merge queue Jun 23, 2026
Merged via the queue into mozilla:main with commit 3f749aa Jun 23, 2026
14 checks passed
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.

3 participants