Skip to content

History keeps the pictures shown last on Featherframe Cloud (W-1009) - #359

Merged
wr merged 1 commit into
mainfrom
wells/w-1009-history-keeps-the-pictures-shown-last-on-featherframe-cloud
Oct 7, 2026
Merged

wr merged 1 commit into
mainfrom
wells/w-1009-history-keeps-the-pictures-shown-last-on-featherframe-cloud

Conversation

@wr

@wr wr commented Oct 7, 2026

Copy link
Copy Markdown
Owner

On Featherframe Cloud the History card lost recent pictures and kept older ones, and the server encoded and uploaded the same full-size JPEGs again and again. From 6 Oct 2026 10:00Z to 7 Oct 2026 04:00Z, Workers observability shows history JPEGs 5750a4a32140b91e, 159d7c9f9fc51bc8, 1a21d60ad4fee1c6, 5718f0b53e30c362 and 77c8c5edaeaa36f7 (all low hex) each PUT and then DELETEd 3–6 times.

Cause
_save_history_thumb pruned frames/history/*.png by file time. On Cloud those PNGs travel in bundles/history.tar (W-985). _tar writes mtime=0 and _unpack writes every file fresh at the start, in sorted path order. After each start the times follow the ETag's hex, so the next commit pruned the lowest ETag, not the oldest picture.

What changes

  • History keeps the newest 24 distinct ETags of the render log, plus the one just committed. Every other <etag>.png and .jpg goes, including a JPEG still at the front door with no PNG beside it.
  • Waiting plates (_prune_views) were ordered by time the same way: a start fetches them in parallel. They now keep the last 8 drawn, by a kv record (waiting_views).
  • thumbs.thumb_for compared a thumbnail's time with its image's. After a start, an image fetched later looked newer and was decoded again for nothing, and an image replaced in an earlier run kept its stale thumbnail. A thumbnail is now drawn once, and whatever replaces its image drops it: a regenerated or restored illustration, the day's collage redrawn.
  • _tar stays deterministic: its hash is what keeps an unchanged archive from being sent again.
  • AGENTS.md: nothing may order files by their times on Cloud.

Verified

  • New tests: 70 history thumbs with times in hex order and a render log in the reverse order; a commit keeps the 23 newest by the log plus itself, and a picture shown twice counts once. Waiting plates kept by the record when their files' times are reversed. Thumbnails dropped on regenerate, restore and a collage redraw, and kept when only the image's time moves.
  • make test: 1241 passed, 2 skipped.

Left

  • On a self-hosted server, a thumbnail already stale before this change (an image replaced and its thumbnail not yet redrawn) stays until the image is replaced again.

Refs W-1009

History pruned frames/history/*.png by file time. A Cloud start unpacks
bundles/history.tar in path order, so the times followed the ETag's hex
and each commit pruned the lowest ETag, not the oldest picture: its
full-size JPEG was encoded and uploaded again whenever the species came
back, and the History card lost recent pictures.

History now keeps the newest 24 distinct ETags of the render log, and
prunes every other PNG and JPEG (one still at the front door too).
Waiting plates keep the last 8 drawn by a kv record, and a thumbnail is
dropped by whatever replaces its image instead of compared by time.

Refs: W-1009
@linear-code

linear-code Bot commented Oct 7, 2026

Copy link
Copy Markdown

W-1009

@wr
wr enabled auto-merge (squash) October 7, 2026 04:46
@wr
wr merged commit c103a1b into main Oct 7, 2026
6 checks passed
@wr
wr deleted the wells/w-1009-history-keeps-the-pictures-shown-last-on-featherframe-cloud branch October 7, 2026 04:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant