voelin-store: a damaged TeamSpeak identity row is reported by its kind of damage, never by its text

Store::identity and Store::identities read the stored JSON of a TeamSpeak
identity with `?`, so a row whose data was damaged outside the client came back
as Error::Json carrying serde_json's message, and that message quotes a value
it refuses: tsproto reports a key that does not import as an invalid value, the
key string and all. The error reaches status lines, events and logs.

identity_from_json classifies the error as voelin-core's ts::identity::from_json
does (voelin-core depends on voelin-store, so the classification is here too):
Error::Identity { damage: IdentityDamage, line, column } says malformed, cut
short, not an identity or unreadable, and where, and nothing of the text.
Error::Json stays for the bookmarks and settings, which hold no secret.

The key store was checked as the recorded leak (docs/session-seam.md 17.6)
names it, and does not leak: check_teamspeak (keystore.rs) drops the parse
error with `let Ok(..) else`, Columns::level uses `map_or`, and the warning of a
damaged binding names the row's kind and uid. A test pins that too.

tests/identity_text.rs damages a row six ways (a key that does not import, a
counter of the wrong type, syntax, a text cut inside its key, bytes that are no
UTF-8 as a BLOB and as TEXT) through a second connection, calls everything of
Store and SqliteKeyStore that reads or writes it, and looks through the errors
(text, Debug and sources) and every log line at TRACE (a capturing subscriber in
tests/support) for any 8 characters in a row of the row's data. A control shows
that serde's own message quotes the value and that the capture sees a warning.
With identity_from_json returning the old error the first test fails, naming
the quoted key; the key store test is a guard.

docs/session-seam.md 17.6: the leak bullet is closed.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
faumarayandClaude Sonnet 5.5 committed 2026-10-25 07:08:35 +03:00
1 parent 412f909d18
commit 18b280df7e
5 files changed
+415 -12

No files matched your search

+21 -9
View File
@@ -1753,15 +1753,27 @@ were fresh compose projects (`down -v`, `up -d`) for each smoke run.
reads the record. The store gained no release call and no "released" record:
`AccountClient::release` ends in `sign_out` with `Auto`, and the design asks
the client to remember nothing of a release.
- **The same leak in `voelin-store`, not closed.** `Store::identity` and
`Store::identities` read the stored JSON of a TeamSpeak identity with `?`, so
an `Error::Json` whose text is the `serde_json` message, which quotes a key
that does not import, as the gate's minor did in the connector. The rows are
written from a `tsclientlib::Identity` (`add_identity`), so a damaged
database is the only way to such a row; the key store (`keystore.rs`) drops
the parse error for the same reason. `ts::identity::from_json` cannot be
used there (`voelin-core` depends on `voelin-store`); the fix is the same
classification in `voelin-store`, or `from_json` moved down.
- **The same leak in `voelin-store`, closed in `phase4/keystore-task34`.**
`Store::identity` and `Store::identities` read the stored JSON of a
TeamSpeak identity with `?`, so an `Error::Json` whose text is the
`serde_json` message, which quotes a key that does not import, as the gate's
minor did in the connector. The rows are written from a
`tsclientlib::Identity` (`add_identity`), so a damaged database is the only
way to such a row. `ts::identity::from_json` cannot be used there
(`voelin-core` depends on `voelin-store`), so the same classification is in
`voelin-store` (`identity_from_json`): the new `Error::Identity { damage,
line, column }` says malformed, cut short, not an identity or unreadable
(`IdentityDamage`), and where, and never the text. The key store
(`keystore.rs`) was checked line by line and does not leak: `check_teamspeak`
and `Columns::level` drop the parse error (`let Ok(..) else` and `map_or`), and
the binding warning names the row's kind and uid, not its data. A test with six
damaged rows (a key that does not import, a field of the wrong type, syntax,
a cut text, bytes that are no UTF-8 as a BLOB and as TEXT) calls everything
of the store and of the key store that reads or writes the row and looks
through the errors (text, `Debug` and sources) and the logs at TRACE for any
8 characters in a row of what the row held
(`crates/voelin-store/tests/identity_text.rs`); it fails with the reader's
message put back.
- The bookmark tests of `link/connect.rs` that still sit in
`ts/ts_session/mod.rs` (17.2) belong next to it.
- `QueryLogin.allowlisted` goes with the query observer (H5), which becomes a