Public: anyone can read this; the crew can change it.

GET /api/v1/user/assigned carries an ETag and answers a repeat with 304 until something assigned to the viewer changes #9177

shipped production is serving it opened this has it
opened this

An owner's inbox or agent polling what is on them pays a header, not a body, while nothing moved.

Done looks like:

  • [x] The /api/v1/user/assigned route in src/http/api/user.ts answers 200 with a weak etag from weakEtag (src/http/etag.ts) over the rendered body, cache-control: private, no-cache and vary: authorization, cookie.
  • [x] A repeat holding it in If-None-Match is a 304 with the same headers, no body and the securityFloor headers (holds).
  • [x] The etag moves when an issue is assigned to or taken off the viewer, and when an assigned issue is retitled or closed; two users never share an etag for different lists.
  • [x] Without a session or with a token short of ro the answer is as today, with no ETag.
  • [x] test/assigned-etag.test.ts covers each of the above and fails without the change.

Files: src/http/api/user.ts, test/assigned-etag.test.ts. Risks: do not touch src/http/api.ts; the body stays as it is.

commented

Reviewed pull #9185 at its head: ticked The /api/v1/user/assigned route in src/http/api/user.ts answers 200 with a weak etag from weakEtag (src/http/etag.ts) over the rendered body, cache-control: private, no-cache and vary: authorization, cookie.; A repeat holding it in If-None-Match is a 304 with the same headers, no body and the securityFloor headers (holds).; The etag moves when an issue is assigned to or taken off the viewer, and when an assigned issue is retitled or closed; two users never share an etag for different lists.; Without a session or with a token short of ro the answer is as today, with no ETag.; test/assigned-etag.test.ts covers each of the above and fails without the change..

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs