Skip to content

fix(measure): read explicit nodes concurrently and let the bridge fall back when Figma cannot load them - #114

Draft
devfive-relay-c70423[bot] wants to merge 1 commit into
mainfrom
devfive/3099154426bffbeef8b62999b80bb038/measure-unloaded-nodes
Draft

devfive-relay-c70423[bot] wants to merge 1 commit into
mainfrom
devfive/3099154426bffbeef8b62999b80bb038/measure-unloaded-nodes

Conversation

@devfive-relay-c70423

Copy link
Copy Markdown
Contributor

Problem

devup_figma_measure timed out on instance-descendant IDs (e.g. I89:6466;89:6479) when the Figma file was out of view.

  • Figma answers reads of nodes it has not loaded with Unable to establish connection to Figma after ~10s each.
  • measure_nodes.js read IDs one by one, so two such nodes took ~20s and exceeded the 15s measure limit.
  • The script relabelled that error read-failed, so the bridge never recognised it and never re-read through the direct (OAuth) path.

Changes

  • measure_nodes.js: read IDs concurrently with Promise.all; tag connection failures reason: "figma-unreachable" with error text capped at 240 chars.
  • measurement.rs:
    • pass through only a fixed set of reason labels (not-found, not-scene-node, read-failed, figma-unreachable); anything else becomes node-read-unavailable. figma-unreachable gets a remediation hint.
    • timeout raised from 15s to READ_TIME_LIMIT so a direct-path re-read can finish.
    • the timeout error carries inView, pluginBuild, limitSeconds and nextAction.
  • Regenerated the plugin scripts bundle, PLUGIN_SCRIPTS_HASH and plugin/dist.
  • Changepack (patch).

Verification

  • cargo test -p devup-mcp --lib measurement (4 passed, including new unavailable_reasons_keep_only_fixed_labels), cargo test -p devup-mcp-figma --lib plugin_scripts, cargo test -p devup-mcp --test bridge_first (18 passed)
  • cargo clippy -p devup-mcp -p devup-mcp-figma --all-targets -- -D warnings, cargo fmt --all -- --check
  • Tested by hand on a real file with the same 7 nodes that had timed out:
    • Figma in front (inView: true): all 7 measured through the bridge in one read.
    • Figma minimized for ~3 min (inView: false): all 7 measured, served by source.kind: "direct" after the bridge fallback. Before this change the same call timed out.

Not verified

  • The bridge host during the manual test was an older build (3b37389, before plugin script identity), so scriptsHash could not be confirmed to be the new one at runtime.

Submitted via Devfive hub. Employee: ; device: 3099154426bffbeef8b62999b80bb038

…l back when Figma cannot load them

Figma answers reads of nodes it has not loaded (file out of view) with 'Unable to establish connection to Figma' after 10s each. measure_nodes.js read IDs one by one and relabelled that error read-failed, so two unloaded nodes exceeded the 15s measure limit and the bridge never re-read through the direct path.

- measure_nodes.js: read IDs with Promise.all; tag connection failures figma-unreachable with a bounded error text
- measurement.rs: pass through only fixed reason labels, hint for figma-unreachable, timeout aligned with READ_TIME_LIMIT, timeout error carries inView/pluginBuild/nextAction
- regenerate plugin scripts bundle, PLUGIN_SCRIPTS_HASH and plugin dist
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.

0 participants