mirror of
https://github.com/storytold/vectorcraft.git
synced 2026-11-27 16:59:43 +01:00
The panel's document.info cache was read by value on every call, so each frame of the panel deep-copied the whole JSON result even when nothing was fetched, a frame with its menu open copied it once more, and a refresh copied it again to store it. The cache is now an Arc: a frame whose key matches returns the stored result, and a refresh stores the new one without a copy. The key is unchanged (document, revision, Selection Only and, while the Artboard tool is current, its options), a category still filters the stored result, and a failed fetch leaves the stored result in place. Tests: frames_that_fetch_nothing_reuse_the_cached_rows checks that idle frames share one result with the same rows as the by-value read, and that each key change stores a new one; cached_rows_read_timing (ignored) times both reads.