A file's revision reads the same after a save as it does when listed #3
Reference in New Issue
Block a user
Delete Branch "etag-one-spelling"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
WsgiDAV lists
getetagbare but sends the same tag quoted in itsETagheader, so a file read back right after a save reported a different revision than the save had returned, even though the bytes were identical. An editor comparing the two would take its own save for an outside change. Every revision is now quoted the way the header spells it;If-Matchaccepts that form.Verified in Memona against a local WsgiDAV: stat, read and the save now report the same revision, a save conditioned on it still lands and a stale one is refused as a conflict. Added a unit test; fmt, clippy and the tests pass.
🤖 Generated with Claude Code
🛑 Changes requested
Please quote bare
W/…tags, remove thread-local state, and makecargo testpass on current stable Rust.Summary
Findings
ETag normalization
W/bypass quoting, so they still disagree with the quoted header spelling. Preserve only syntactically quoted weak tags (W/"…") and add a regression test.Thread-local session state
src/lib.rs:31usesthread_local!, which violates the repository's event-driven concurrency rule. Move connection state into an event-driven/component-scoped mechanism permitted by the rules.Tests do not link
cargo testfails on stable Rust 1.98.1 while linking thecdylib: rust-lld rejects generated WIT export names in the version script. Make the test target link on the supported toolchain (or pin and document a compatible toolchain).Checks
cargo fmt --checkcargo clippy --all-targets -- -D warningscargo testStrength
Declined to judge
@@ -210,0 +215,4 @@/// gives every revision one spelling, and `If-Match` accepts that form.pub fn etag(value: &str) -> String {let value = value.trim();if value.starts_with('"') || value.starts_with("W/") {A bare opaque tag can legitimately begin with
W/; this branch leaves it unquoted, so it still differs from the correspondingETag: "W/..."header and breaks revision equality. Preserve only a syntactically quoted weak tag (W/"…"), quote all other bare values, and cover that case.The bare
W/case is fixed in the new head with a test. The other two findings predate this change and are left alone here: thethread_local!session is the one per-instance slot a WASI component has between exported calls, as the comment above it explains, and plaincargo testfails because the host cannot link thecdylibexport names; the README runscargo test --locked --lib, which passes.✅ Approved
Summary
W/…values are normalized and covered by regression tests.Findings
Checks
cargo fmt --checkcargo clippy --locked --all-targets -- -D warningscargo test --locked --lib(12 tests)cargo build --locked --release --target wasm32-wasip2Strength
Declined to judge
thread_local!: component-scoped session storage, not a thread-based concurrency model; its single-threaded host contract is documented.cargo test: not the documented project check; the documented library-test command passes.