A file's revision reads the same after a save as it does when listed #3

Merged
temeddix merged 2 commits from etag-one-spelling into main 2026-09-25 17:43:51 +00:00
Owner

WsgiDAV lists getetag bare but sends the same tag quoted in its ETag header, 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-Match accepts 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

WsgiDAV lists `getetag` bare but sends the same tag quoted in its `ETag` header, 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-Match` accepts 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](https://claude.com/claude-code)
temeddix added 1 commit 2026-09-25 17:24:56 +00:00
temeddix requested review from bot 2026-09-25 17:25:00 +00:00
bot requested changes 2026-09-25 17:29:16 +00:00
Dismissed
bot left a comment
Owner

🛑 Changes requested
Please quote bare W/… tags, remove thread-local state, and make cargo test pass on current stable Rust.

Summary

  • 3 important blockers.

Findings

ETag normalization
  • Important: bare values beginning 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
  • Important: src/lib.rs:31 uses thread_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
  • Important: cargo test fails on stable Rust 1.98.1 while linking the cdylib: 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
  • Passed: cargo fmt --check
  • Passed: cargo clippy --all-targets -- -D warnings
  • Failed: cargo test
Strength
  • The shared normalization helper consistently covers PROPFIND, GET fallback, and PUT responses.
Declined to judge
  • None.

Profile: codex · gpt-5.6-terra

🛑 Changes requested Please quote bare `W/…` tags, remove thread-local state, and make `cargo test` pass on current stable Rust. ## Summary - 3 important blockers. ## Findings <details> <summary>ETag normalization</summary> - Important: bare values beginning `W/` bypass quoting, so they still disagree with the quoted header spelling. Preserve only syntactically quoted weak tags (`W/"…"`) and add a regression test. </details> <details> <summary>Thread-local session state</summary> - Important: `src/lib.rs:31` uses `thread_local!`, which violates the repository's event-driven concurrency rule. Move connection state into an event-driven/component-scoped mechanism permitted by the rules. </details> <details> <summary>Tests do not link</summary> - Important: `cargo test` fails on stable Rust 1.98.1 while linking the `cdylib`: 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). </details> <details> <summary>Checks</summary> - Passed: `cargo fmt --check` - Passed: `cargo clippy --all-targets -- -D warnings` - Failed: `cargo test` </details> <details> <summary>Strength</summary> - The shared normalization helper consistently covers PROPFIND, GET fallback, and PUT responses. </details> <details> <summary>Declined to judge</summary> - None. </details> > Profile: `codex` · `gpt-5.6-terra`
@@ -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/") {
Owner

A bare opaque tag can legitimately begin with W/; this branch leaves it unquoted, so it still differs from the corresponding ETag: "W/..." header and breaks revision equality. Preserve only a syntactically quoted weak tag (W/"…"), quote all other bare values, and cover that case.

Profile: codex · gpt-5.6-terra

A bare opaque tag can legitimately begin with `W/`; this branch leaves it unquoted, so it still differs from the corresponding `ETag: "W/..."` header and breaks revision equality. Preserve only a syntactically quoted weak tag (`W/"…"`), quote all other bare values, and cover that case. > Profile: `codex` · `gpt-5.6-terra`
Author
Owner

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: the thread_local! session is the one per-instance slot a WASI component has between exported calls, as the comment above it explains, and plain cargo test fails because the host cannot link the cdylib export names; the README runs cargo test --locked --lib, which passes.

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: the `thread_local!` session is the one per-instance slot a WASI component has between exported calls, as the comment above it explains, and plain `cargo test` fails because the host cannot link the `cdylib` export names; the README runs `cargo test --locked --lib`, which passes.
temeddix requested review from bot 2026-09-25 17:37:39 +00:00
temeddix added 1 commit 2026-09-25 17:37:39 +00:00
bot approved these changes 2026-09-25 17:42:39 +00:00
bot left a comment
Owner

✅ Approved

Summary

  • Bare W/… values are normalized and covered by regression tests.

Findings

  • None.
Checks
  • Passed: cargo fmt --check
  • Passed: cargo clippy --locked --all-targets -- -D warnings
  • Passed: cargo test --locked --lib (12 tests)
  • Passed: cargo build --locked --release --target wasm32-wasip2
Strength
  • The shared helper keeps PROPFIND, GET, and PUT revisions consistent.
Declined to judge
  • thread_local!: component-scoped session storage, not a thread-based concurrency model; its single-threaded host contract is documented.
  • Plain cargo test: not the documented project check; the documented library-test command passes.

Profile: codex · gpt-5.6-terra

✅ Approved ## Summary - Bare `W/…` values are normalized and covered by regression tests. ## Findings - None. <details> <summary>Checks</summary> - Passed: `cargo fmt --check` - Passed: `cargo clippy --locked --all-targets -- -D warnings` - Passed: `cargo test --locked --lib` (12 tests) - Passed: `cargo build --locked --release --target wasm32-wasip2` </details> <details> <summary>Strength</summary> - The shared helper keeps PROPFIND, GET, and PUT revisions consistent. </details> <details> <summary>Declined to judge</summary> - `thread_local!`: component-scoped session storage, not a thread-based concurrency model; its single-threaded host contract is documented. - Plain `cargo test`: not the documented project check; the documented library-test command passes. </details> > Profile: `codex` · `gpt-5.6-terra`
temeddix merged commit 5d46485dad into main 2026-09-25 17:43:51 +00:00
temeddix deleted branch etag-one-spelling 2026-09-25 17:43:51 +00:00
Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: commons/memona-plugin-signature#3