Bug 2050036 - Add Store::shutdown() to close the autofill DB connection#7490
Open
DimiDL wants to merge 1 commit into
Open
Bug 2050036 - Add Store::shutdown() to close the autofill DB connection#7490DimiDL wants to merge 1 commit into
DimiDL wants to merge 1 commit into
Conversation
mhammond
previously approved these changes
Jul 22, 2026
| // This is the type that uniffi exposes. | ||
| pub struct Store { | ||
| pub(crate) db: Mutex<AutofillDb>, | ||
| pub(crate) db: parking_lot::Mutex<Option<AutofillDb>>, |
Member
There was a problem hiding this comment.
fwiw, many of our crates use parking_lot::Mutex and typically just use it directly rather than fully qualifying it in each use. I'm not against doing it this way, but fyi
Contributor
Author
There was a problem hiding this comment.
thank you for the review! Updated to follow the convention.
The connection is otherwise only closed when the Store is dropped, which on Firefox Desktop happens during GC at shutdown -- past the late-write barrier, so the flush crashes debug builds. Wrap the connection in Mutex<Option<AutofillDb>> behind a fallible lock_db() helper (mirroring LoginStore); shutdown() closes it early, and later operations return DatabaseClosed.
DimiDL
force-pushed
the
passport-autofill-shutdown
branch
from
July 22, 2026 05:56
3fedaa3 to
12f51d6
Compare
mergify
Bot
dismissed
mhammond’s stale review
July 22, 2026 05:56
The pull request has been modified, dismissing previous reviews.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The connection is otherwise only closed when the Store is dropped, which on Firefox Desktop happens during GC at shutdown -- past the late-write barrier, so the flush crashes debug builds.
Wrap the connection in Mutex<Option> behind a fallible lock_db() helper (mirroring LoginStore); shutdown() closes it early, and later operations return DatabaseClosed.
Pull Request checklist
[ci full]to the PR title.