openpencil/tests/engine/io/fig/import
Danila Poyarkov a2d0d6552d
fix(fig): harden document worker sessions (#594)
* fix(app): cancel large FIG opens before tab cleanup

- Abort tab-local preparation before awaiting recovery persistence so closing a decoding tab terminates its FIG worker immediately
- Add explicit graph-event unsubscription and lazy FIG resource release for disposed editor stores
- Keep staging-editor disposal separate from live graph resource ownership
- Let same-origin document fetches bypass all cross-origin font response limits

* refactor(fig): isolate worker sessions per document

- Give each lazy FIG document a dedicated MessageChannel and retained worker session
- Route manifest and page population traffic through the session port instead of global worker handlers
- Close the port and worker explicitly on cancellation or tab disposal
- Preserve current lazy source transfer and export fidelity until raw NodeChange patch export is implemented

* perf(fig): preserve unchanged archives in worker sessions

- Keep a second transferable copy of the original FIG archive inside the document worker session instead of main-thread memory
- Track whether user graph mutations invalidate exact archive reuse
- Return unchanged documents byte-for-byte through the session without full-page materialization or recompression
- Release archive request ownership with the page population worker and editor graph resources

* fix(fig): choose the first visible imported page

- Ignore internal-only canvases when selecting the initial active page\n- Keep internal component pages available for lazy instance population

* fix(fig): retain original archives across fallbacks

- Keep session-owned workers alive when population is oversized\n- Register the input archive when worker graph transfer falls back to the main thread\n- Preserve byte-identical unchanged saves without restoring lossy materialization

* fix(fig): harden worker session ownership

- Route concurrent archive replies through persistent request resolvers and reject stale in-flight archives after edits\n- Retain disposal-only handles for oversized sessions and guard Worker construction\n- Reuse the shared FIG import options contract and cover session disposal and invalidation

* test(fig): isolate Worker availability mutation
2026-08-30 21:40:13 +03:00
..
legacy feat(fig): support text on path 2026-08-17 12:00:01 +03:00
basic.test.ts test(engine): align io tests with source tree 2026-05-16 11:59:02 +03:00
boolean-operation.test.ts refactor(fig): own instance interpretation 2026-07-18 02:06:34 +03:00
cancellation.test.ts feat(app): prepare documents atomically per tab (#592) 2026-08-30 12:21:49 +03:00
component-props.test.ts fix(fig): harden component property round trips 2026-08-19 18:05:25 +03:00
derived-symbol-data.test.ts feat(fig): support text on path 2026-08-17 12:00:01 +03:00
edge-cases.test.ts fix(fig): preserve paint variable overrides 2026-07-22 15:51:46 +03:00
field-protection.test.ts fix(fig): preserve paint variable overrides 2026-07-22 15:51:46 +03:00
font-variations.test.ts refactor(fig): own instance interpretation 2026-07-18 02:06:34 +03:00
group-reclassify.test.ts refactor(fig): own instance interpretation 2026-07-18 02:06:34 +03:00
instance-regressions.test.ts feat(fig): support text on path 2026-08-17 12:00:01 +03:00
lazy-pages.test.ts fix(cli): populate lazy FIG pages 2026-07-22 14:56:58 +03:00
mask-oracle.test.ts refactor(fig): own instance interpretation 2026-07-18 02:06:34 +03:00
masks.test.ts refactor(fig): own instance interpretation 2026-07-18 02:06:34 +03:00
paint-schema-fields.test.ts refactor(fig): own instance interpretation 2026-07-18 02:06:34 +03:00
pattern-paint-oracle.test.ts feat: split SceneGraph and Pen packages 2026-06-30 10:54:32 +03:00
population-delta.test.ts feat(fig): prototype lazy population worker 2026-08-07 09:27:54 +03:00
property-integrity.test.ts test(engine): align io tests with source tree 2026-05-16 11:59:02 +03:00
raw-field-coverage.test.ts refactor(fig): own instance interpretation 2026-07-18 02:06:34 +03:00
raw-metadata-oracle.test.ts feat: split SceneGraph and Pen packages 2026-06-30 10:54:32 +03:00
rich-text-oracle.test.ts refactor(fig): own instance interpretation 2026-07-18 02:06:34 +03:00
scaled-instance-strokes.test.ts fix(fig): preserve derived instance geometry 2026-07-21 02:31:44 +03:00
schema-coverage.test.ts fix(fig): address instance rendering review 2026-08-10 05:09:03 -03:00
session-ownership.test.ts fix(fig): harden document worker sessions (#594) 2026-08-30 21:40:13 +03:00
style-refs.test.ts fix(fig): address instance rendering review 2026-08-10 05:09:03 -03:00
text-path.test.ts feat(fig): support text on path 2026-08-17 12:00:01 +03:00
text-sizing.test.ts fix(text): preserve Figma auto-size text imports 2026-07-02 17:30:15 +03:00