Files
outline/server
Tom MoorandClaude Opus 5 6905c9ba9c fix: Stabilize signed attachment urls so browser caches can be reused (#13462)
* fix: Stabilize signed attachment urls so caches can be reused

Every call to getSignedUrl produced a unique signature, so the same
attachment was downloaded again for each URL. On a public share the
first image was fetched twice at full size: once by the preload scanner
from the server-rendered HTML, and again when the client rendered the
document from the API response.

- Round the signing timestamp down to a window so repeated signatures of
  the same key are identical. The window is capped at half the requested
  lifetime, so a URL is always valid for at least half of expiresIn and
  never outlives the lifetime it had before.
- Apply to all three signing paths: the S3 presigner, CloudFront, and
  the JWT used by local storage.
- Sign the share page HTML with the same lifetime the API presenter
  uses, so the two agree.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* test: Freeze time in signed url tests

The suites read the wall clock, so two calls could straddle a signing
window boundary and fail intermittently. Freeze the clock at a time
offset from a boundary, then advance it explicitly to cover both cases:
within a window the signature holds, across a boundary it rotates.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-16 17:35:23 -04:00
..
2026-08-16 16:36:13 -04:00
2026-08-16 16:36:13 -04:00
2026-08-15 13:25:10 -04:00
2026-08-15 13:25:10 -04:00
2026-08-15 13:25:10 -04:00
2026-08-15 13:25:10 -04:00