Let a sign-out finish when a row's binding columns cannot be read
SqliteKeyStore::list() failed on the first row whose binding columns were damaged outside this crate (synced = 2 on the account record, say), and KeyStore::sign_out starts with list() through bound_to(): it never reached the record, so it could never finish, and DeviceKeyChoice::Forget did not delete the key it was given either. get() failed the same way where sign_out reads the record and the device key. A row whose binding columns cannot be read (refused by AccountBinding::from_columns, or a value of the wrong type) is now listed and read as unbound, with a tracing warning that names the row and the reason and quotes no content. Unbound is the reading that never deletes on a guess: such a row is not deleted as a synced copy, and a put of it writes four good columns. A data column that is not text is read as text with the odd bytes replaced, so a record that cannot be read is deleted by the trait's sign_out instead of its read failing; a row whose kind or uid is not text cannot be addressed and the list leaves it out with a warning. list() now fails only when the database does. Tests: the gate's probe (UPDATE identities SET synced = 2 WHERE kind = 'account', then sign_out with Auto and with Forget on a store with bound_existing_key true and false), more damage to the record row, the device key row and a synced copy, and the unreadable data and kind/uid cases; the test that asserted the old precise errors of get() and list() now asserts the unbound reading. The six new tests fail on the previous keystore.rs. voelin-store gets the tracing dependency (already in the lock); Cargo.lock changes, THIRD_PARTY_NOTICES.md is unchanged by it. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
7c6d149f78
commit
4944a0694b
5 files changed
+382
-59
No files matched your search
Generated
+1
@@ -9703,6 +9703,7 @@ dependencies = [
|
||||
"serde",
|
||||
"serde_json",
|
||||
"thiserror 2.0.21",
|
||||
"tracing",
|
||||
"tsclientlib",
|
||||
"voelin-identity",
|
||||
]
|
||||
|
||||
Reference in new issue
Block a user