Make `DatabaseLoginsStorage` async
There hasn't been agreement on a grand vision for async Rust in app-services (#6549). I think part of the reason is that ADR is discussing too many things. This is my attempt to take a small change from that ADR and see if we agree.
This change takes the async wrapping code that's currently in android-components and moves it to our app-services wrapper. This improves the API boundary IMO. The SYNC sync and the credentials management teams are responsible for threading issues. For example, we're the one's thinking through how to avoid blocking too many threads when we're waiting on the primary password dialog. Since we're responsible for threading issues, we should own the code
On a practical level: I have some ideas on how to improve our threading strategy and it's simpler to think about those changes if all the code is in one repo.
Here's the corresponding android-components change: https://github.com/bendk/firefox/commit/d038ba6fd1ec1b39f76e0720e594916d61a4600a
If we agree on this, then I think we can do something similar for iOS.
What do others think? Is this a good idea? Do we need/want an ADR for this?
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
- [ ] This PR follows the breaking change policy:
- [ ] 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.
- For changes that need extra cross-platform testing, consider adding
- Note:
- [ ] 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.