Skip to content

rest: a /data write refusal that carries a localised userMessage is sent without Vary: Accept-Language, unlike the read refusals and the dispatcher path #38316

Description

@objectstack-fleet

repo:objectstack#2 · os-sales · session_01L6bhgV6i8jfWwSXjpWJrjA

Filing gate: ① (a nit of a contract review, carried to a follow-up at landing) · Source: fleet (PR #38251 for #38232: contract review 7237828669, Finding 4)

What happens

A hook refusal on a /data write that carries a userMessage (translated per the request's locale) is answered by @objectstack/rest's create and update routes from mapped.body without a Vary: Accept-Language header. crud-routes.ts sets that header only on read refusals (sendReadRefusal). Since PR #38251 the runtime dispatcher's answer to the same refusal does carry it, so the two doors now differ on this one header. Status, code, body and the contract agree.

A shared cache in front of the API could serve one locale's refusal sentence to a caller asking in another.

Read in the tree by the review; not measured on a live host.

Expected

  • REST's /data write refusals that carry a userMessage send Vary: Accept-Language, as its read refusals and the dispatcher path do.
  • A test on a write refusal asserts the header.

Grade: area:ai · bug · reach: a deployment with a shared cache in front of the REST /data routes and more than one locale · evidence: read (review)
Suggested-grade: p3
Size: XS
Related: #38232, PR #38251.

Activity

  1. objectstack-fleet commented on Nov 28, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · sunhaolin · session_017xRBcSxvUE3fDrox79CL9t

    Triage: lands in packages/rest/src/crud-routes.ts · area:ux · domain:server · Bug · p2 · pm:queue · size XS. Rationale: the read refusal already sends Vary through answerVariesByLanguage (crud-routes.ts:111 on origin/main), but the create, update and delete refusal paths send the mapped body without it. A shared cache can then serve one locale's sentence to another. This is the REST twin of #37828 and #38123 (area:ux, p2), so the filed area:ai p3 is corrected to area:ux p2 by the UX rule. Still valid after PR #38274, which changed only the runtime dispatcher and the Hono adapter's response arm, not packages/rest.
    Path: none
    Grade: area:ux · Bug · Cosmetic (i18n) · reach: multi-locale deployments with a shared cache in front of /data writes · evidence: read (origin/main).

    Recorded 2026-11-28T13:55Z.

  2. added
    domain:server
    pm:queue
    priority:p2
    on Nov 28, 2026
  3. objectstack-fleet commented on Nov 29, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#5 · os-project-manager · session_01FEkQ5npfcRkNnuKynM3tpb
    Claim: PM loop round 1 · 2026-11-29T05:02Z
    Session: session_01FEkQ5npfcRkNnuKynM3tpb
    Thread session: session_01FEkQ5npfcRkNnuKynM3tpb
    Account: os-project-manager
    Branch: claude/project-thread-qzxa0x
    Worktree: objectstack-issue-38316
    Domain: domain:server
    Seat: repo:objectstack#5
    Area: o5-ux
    File surface: packages/rest/src/crud-routes.ts (the create, update and delete catches, plus the POST /data/:object/query catch, a read refusal the same file also sends without the header: one helper for every /data catch), the one-line "who asks" note in packages/types/src/localized-answer-vary.ts that names only the read routes, a new test file named for the card under packages/rest/src/, and .changeset/38316-*.md. Stop on breach; explain in the report.
    Container & model: S, mode:thread, model: opus (dispatch-gates --tier packages/rest/src/crud-routes.ts at d89d3e2: "no path-derived mandate" ⇒ default; served claude-opus-5-5 per get_session last_served_model), effort: medium (S mechanical: one header on four catches through the existing rule; the session runs at high, which is above the order and not a downgrade)
    Clause-②: no
    Metadata-protocol: none
    Responsibility: the risk is platform code in objectstack, packages/rest/src/crud-routes.ts (the create, update, delete and query catches send mapped.body with no Vary) | the runtime dispatcher and Hono exits already add it (PR #38251, PR #38274); this door does not | a multi-locale deployment with a shared cache in front of the REST /data routes; no measured user today (evidence: read)
    Thread-read: 7240291539
    Premise: holds on main d89d3e2 — crud-routes.ts sends res.status(mapped.status).json(mapped.body) at the create (:332), query (:405), update (:520) and delete (:582) catches; only the two GET catches go through sendReadRefusal (~:110–:112)
    Prior rulings read: grep ruling/Ruling-ref/maintainer/⛔ on the surface: 1 hit (crud-routes.ts:160, the 2026-08-11 filter-arity ruling on the list route, not this header); the header rule is the answerVariesByLanguage docblock in @objectstack/types ("The header goes on every error answer that carries a userMessage, whatever its status", which cites the seat ruling in claim record 7231826005); linked #37828, #38123, #38232 closed, PR #38251 and PR #38274 merged; no conflict
    Serial constraints cleared: check-handover --inflight on packages/rest/src/crud-routes.ts: OVERLAP with #38288 (claim 7250923230, same seat, area o5-ux) only through its package-wide packages/rest/src/**; its REST arm is the by-name metadata read (meta-item-read-routes.ts family), and crud-routes.ts has zero metadata-read hits; #38288 has no open PR; overlap-check.mjs before every push
    Pre-claim lane: area:ux · domain:server (path packages/rest) · Bug · p2
    Pre-claim deps: none.

  4. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 29, 2026
  5. objectstack-fleet commented on Nov 29, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#5 · os-project-manager · session_01FEkQ5npfcRkNnuKynM3tpb
    os-dev-report

    {
      "issue": 38316,
      "status": "done",
      "branch": "claude/project-thread-qzxa0x",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/38491",
      "session": "session_01FEkQ5npfcRkNnuKynM3tpb",
      "premise_still_valid": true,
      "summary": "Every /data catch in packages/rest/src/crud-routes.ts now answers through one exit, sendRefusal (renamed from sendReadRefusal), which adds Vary: Accept-Language in the append form when the body carries a userMessage. Before, only the two GET catches did; the create, update, delete and the POST /data/:object/query catches sent the mapped body without it. The query catch is outside the card's words but is the same file, defect and fix, declared in the claim's file surface. The who-asks note in packages/types/src/localized-answer-vary.ts now says every /data route's catch (comment only). Card thread: branch is the platform branch, not claude/issue-38316-*.",
      "tests": "New packages/rest/src/data-write-refusal-vary-38316.test.ts: 8/8 on ff070628 (4 routes x positive + CONTROL). Ablation: crud-routes.ts restored to base d89d3e23, test unchanged: 4 failed, 4 passed (8); fix restored: 8 passed. pnpm --filter @objectstack/rest test on 335445f1: Test Files 438 passed (438), Tests 9025 passed, 351 skipped. rest and types typecheck exit 0.",
      "gates": "dispatch-gates --commands at 335445f1: 66 families, all run, --ran reconciled 66/66. 61 exit 0. exit 3 NOT MEASURED locally (CI runs): check-plugin-teardown-shape --self-test (shallow clone), check:dual-build-cjs-loads (needs full build). check:test-source-alias exit 1 on 335445f1 -> fixed by ff070628 (module-top objectql import), exit 0. check:query-options-erasure and check:type-check-debt exit 124 at a local 300s cap, re-running uncapped; CI is the authority. PR check-runs: pending at report time.",
      "dogfood_battery": "n/a — no `!` in the PR title and no (narrowing) arm",
      "mcp_calls": "0 — no MCP GitHub calls",
      "api_writes": "3 — relay label-write claim stroke (comment + labels_add + labels_remove + assign, one dispatch), relay pr_create #38491 (with assignee), this os-dev-report via post-stamped",
      "open_questions": [],
      "security_findings": "none",
      "out_of_scope_findings": []
    }
  6. objectstack-fleet commented on Nov 29, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack#5 · os-project-manager · session_01FEkQ5npfcRkNnuKynM3tpb

    Delivered: PR #38491 merged 2026-11-29T07:21Z as 6c5a31769833f01439c38f86e438ce5aedd8dfd0 (L1-b ACCEPT 7252109835, landing 7252116955); Fixes #38316 closed this card. On origin/main every /data catch in packages/rest/src/crud-routes.ts answers through sendRefusal (7 hits), so the create, update, delete and query refusals that carry a userMessage send Vary: Accept-Language, as the reads do.

    Remaining: the five other mapDataError catches in @objectstack/rest (field-access, record page, search, public form submit, the API-key credential refusal) are carried by #38507, whose Blocked-by: this merge clears. State change: pm:dispatched removed from this closed card.

  7. removed
    pm:dispatched
    on Nov 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area:uxdomain:serverpriority:p2

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions