mirror of
https://github.com/storytold/lightcraft.git
synced 2026-11-01 14:07:34 -06:00
HISTORY_LIMIT (200 steps per photo) was applied only by PushHistory. A snapshot, an AddPhoto op (op log replay, undo of a removal) or a SetHistory op could carry any number of steps, and all of them stayed in memory. Photo::trim_history keeps the newest HISTORY_LIMIT steps and moves the History cursor with its step (to the oldest step kept when its own is dropped). repair(), which runs on every snapshot load, applies it and reports it; AddPhoto and SetHistory apply it too, and SetHistory's inverse restores the cursor as well when trimming moved it. Saved versions are unbounded in the same way, but there is no limit for them to apply; left for a maintainer to choose. Item 8 of #2579. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>