fix(storage): skip the browser cache for S3 requests (#980)

S3 objects change under the same URL, and servers such as rclone serve s3 answer a ranged GET with 200 instead of 206. The browser then caches the partial preview read as the full object and returns it for the next full read, which fails as an invalid fig-kiwi container. Send storage fetches with cache: 'no-store'.

Co-authored-by: Niraj <16096118+T3rM1nAt0-R@users.noreply.github.com>
Co-authored-by: Danila Poyarkov <dev@dannote.net>
This commit is contained in:
T3rM1nAt0-R 2026-10-08 17:34:02 +00:00 committed by GitHub
parent 3289649da8
commit 230b14080e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 0 deletions

View file

@ -126,6 +126,7 @@
### Fixed
- Open S3 storage documents completely after their previews load. Storage servers that answer a preview's byte-range read with the whole-file status, such as `rclone serve s3`, left the browser holding the partial reply as the document, so the next open failed with "Invalid fig-kiwi container". Storage requests now skip the browser cache.
- Keep a layer's `.fig` ID the same across saves (#890). Layers created in OpenPencil were numbered in tree order on each save until the file was reopened, so inserting a layer shifted the IDs of the layers after it; variable collections and modes could also be renumbered.
- Store crash recovery snapshots of any size. Snapshots of documents over 127 MiB failed to save to IndexedDB and stayed in memory for the rest of the session.
- Keep an opened `.fig` file saved until it is edited. Laying out its first page, which recomputes auto-layout sizes and positions, and showing another page for the first time, which loads its layers from the file, marked it unsaved, so closing it asked to save changes nobody made.

View file

@ -143,6 +143,9 @@ export async function s3Request(
headers: signed.headers,
body: init.body ?? undefined,
credentials: 'omit',
// Objects change under the same URL, and a ranged read answered with 200 would
// otherwise be cached as the whole object and returned for the next full read.
cache: 'no-store',
signal: init.signal
})
}