Fix #280: third cache class for mutable state #292

Merged
crueber merged 2 commits from fix/issue-280 into main 2026-09-10 15:31:49 +00:00
Owner

Supersedes #259's scoped thread fix with the systemic fix #280 proposes: a third cache class private, no-cache for mutation-sensitive GETs (07_api.md §4 amended; Decisions entries in 07_api + 07/03/01/08 feature specs).\n\nApplied with version-keyed ETags intact: social counters, releases single/latest/list/autodraft, pull view (ETag folds head/base live shas + thread/pr versions + mergeable stamp — HeadLive alone would 304 a commented thread), identity profile/org/members/team/access (+ tokenless lists take the class without an ETag). Git-content routes (summary/refs/tree/blob/commits, asset bytes, pull diff) keep byte-identical SWR/immutable headers. Issues thread untouched (already no-cache via #259).\n\nTests: table-driven httptest per surface (exact class, stale-ETag → 200 fresh, fresh → 304, token movement on mutation). Coverage: social 99.5 / releases 99.8 / pulls 97.7 / identity 97.2. gofmt/vet clean, -race green (incl. issues + api sanity). SDK comment touch-ups only; JS SDK suite 106/106 (full web glob has pre-existing env hangs, verified on pristine main). No browser run (backend-only; header contract is curl-verifiable).\n\nOut of scope (noted, not built): client invalidate+revalidate belt-and-suspenders (#280 item 4), shared-const consolidation (per-package ccMutable follows the writeCached/matchETag duplication + #259 ccThread precedent).\n\nDo NOT merge — review requested.

Supersedes #259's scoped thread fix with the systemic fix #280 proposes: a third cache class `private, no-cache` for mutation-sensitive GETs (07_api.md §4 amended; Decisions entries in 07_api + 07/03/01/08 feature specs).\n\nApplied with version-keyed ETags intact: social counters, releases single/latest/list/autodraft, pull view (ETag folds head/base live shas + thread/pr versions + mergeable stamp — HeadLive alone would 304 a commented thread), identity profile/org/members/team/access (+ tokenless lists take the class without an ETag). Git-content routes (summary/refs/tree/blob/commits, asset bytes, pull diff) keep byte-identical SWR/immutable headers. Issues thread untouched (already no-cache via #259).\n\nTests: table-driven httptest per surface (exact class, stale-ETag → 200 fresh, fresh → 304, token movement on mutation). Coverage: social 99.5 / releases 99.8 / pulls 97.7 / identity 97.2. gofmt/vet clean, -race green (incl. issues + api sanity). SDK comment touch-ups only; JS SDK suite 106/106 (full web glob has pre-existing env hangs, verified on pristine main). No browser run (backend-only; header contract is curl-verifiable).\n\nOut of scope (noted, not built): client invalidate+revalidate belt-and-suspenders (#280 item 4), shared-const consolidation (per-package ccMutable follows the writeCached/matchETag duplication + #259 ccThread precedent).\n\nDo NOT merge — review requested.
07_api.md §4 grows a mutable-collab class: version-keyed GETs revalidate
on every read instead of serving the SWR stale window (the refresh
flip-flop). Applied to social, releases (single/latest/list/autodraft),
pull view (ETag folds head/base live shas + thread/pr versions +
mergeable stamp — HeadLive alone would 304 a commented thread), and all
identity GETs; git-content routes keep byte-identical SWR/immutable
headers. Table-driven httptest per surface: exact class, stale→200
fresh, fresh→304, token movement on mutation. Docs: 07_api §4 +
Decisions, 07/03/01/08 feature specs + SDK comments.
Sign in to join this conversation.
No description provided.