The desktop transcript inbox commits a batch before projecting it into <userData>/transcripts/<threadId>.jsonl. These tests lock the checks that keep a path-like id from becoming a file, a full inbox from dropping unprojected history or wedging forever, and a replay from rewriting a tampered projection.
../escape, spaces, slashes, backslashes, non-ASCII, newlines, length 257) and unsafe thread ids (../outside, nested/name, nested\\name, thread.id, .., non-ASCII, NUL, length 257) are rejected with the route sentences before the SQLite inbox or any transcript file is created. A 256-character batch id and batch.name_1:part-2 are accepted, and the projected delivery id is <batchId>:0.Idempotency-Key must match batchId. A blank header is ignored. Surrounding spaces are trimmed and then compared. A mismatch writes nothing.Transcript inbox capacity reached, is not inserted, and creates no transcript file. Pending rows are not evicted.Idempotency key conflicts with the existing transcript projection. The file stays tampered and is not appended, event_json still has payload text first, and projected stays 0.crates/cowork-server/tests/transcript_inbox_identity_and_capacity.rsThread ids are joined onto the transcripts directory, so skipping the charset check can write outside that directory (../outside resolves to <userData>/outside.jsonl). The cap treats pending and completed receipts differently: dropping a pending batch loses unprojected history, and refusing to evict completed batches wedges the inbox after ordinary use. The conflict check is what stops a replay from papering over a changed JSONL line.
No production behavior changes. Main is still a1ce8cd9. This does not duplicate the open coverage PRs #394–#399.
cargo test -p cowork-server --test transcript_inbox_identity_and_capacity --test desktop_transcript_batch_receipts --test desktop_state_and_transcript_generations: 17 passedcargo clippy -p cowork-server --test transcript_inbox_identity_and_capacity -- -D warnings: cleancargo fmt -p cowork-server -- --check: cleanSign in to comment.
Update README.md
#125 mobile-fixes ← main
Updated 5 months ago