Skip to content

Bug 2049279 - Add passport record type to autofill#7440

Open
DimiDL wants to merge 1 commit into
mozilla:mainfrom
DimiDL:passport-autofill
Open

Bug 2049279 - Add passport record type to autofill#7440
DimiDL wants to merge 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.

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".

@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 :)

}

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

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.

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.

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