penpot/frontend/test/frontend_tests
Luke Lau a089f7a5a1
🐛 Fix library telemetry counters (#12787)
At some point the code around this changed, I believe this used to reduce over
file ids. However today it reduces over entire library maps, so it passes a map
instead of an id to `dm/get-in files`. This then hashes the library which
forces it to decode all of its shapes, and then it fails to lookup the data. So
the component/colors/typography counts were always returning 0.

Using reduce-kv fixes this, and we can just get the library data directly with
`(:data library)`.

On the backstage file in penpot-files this brings the time to the telemetry
snapshot down from 3.8s to 1.5s

AI-assisted-by: claude-5.5-sonnet

Co-authored-by: Andrey Antukh <niwi@niwi.nz>
2026-11-04 10:44:30 +01:00
..
2026-11-04 10:44:30 +01:00