Skip to content

Bug 2053557 - remove all logins without decrypting#7467

Merged
jo merged 1 commit into
mozilla:mainfrom
jo:bug-2053557
Jul 9, 2026
Merged

Bug 2053557 - remove all logins without decrypting#7467
jo merged 1 commit into
mozilla:mainfrom
jo:bug-2053557

Conversation

@jo

@jo jo commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

https://bugzilla.mozilla.org/show_bug.cgi?id=2053557

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.

@jo jo requested review from bendk and mhammond July 9, 2026 09:52

@bendk bendk 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 to me, I just had a question about one of the queries

let ids: Vec<String> = self.db.query_rows_and_then_cached(
"SELECT guid FROM loginsL WHERE is_deleted = 0
UNION ALL
SELECT guid FROM loginsM WHERE is_overridden = 0",

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.

Why do you need the second query? I would have thought the loginsL one would be enough. I'm guessing I'm missing something, could you add a comment explaining. The same applies to delete_all_except_fxa.

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.

This is a very good question which I have to admin I cannot answer. I looked at the get_all query and replicated it for the needs here. Throughout the code we union against both tables. 🤔

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 think that's the way logins work: https://github.com/mozilla/application-services/blob/main/components/logins/src/db.rs#L7-L24

When we want to fetch a record, we need to look in both loginsL and loginsM for the data.

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.

Ahh, so if a record isn't updated then there won't be a row in loginsL. I always forget that and picture it working the opposite way. This all makes sense and seems good to merge to me.

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.

yeah, this bites me regularly too. It's "clever", but borders on "too clever" 😅

@jo jo added this pull request to the merge queue Jul 9, 2026
Merged via the queue into mozilla:main with commit f829026 Jul 9, 2026
14 checks passed
@jo jo deleted the bug-2053557 branch July 9, 2026 18:09
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