REST API ↔ Plugin API: Do Variant Updates Propagate Consistently?
0 reputation · 23 Aug 2023, 17:05 UTC
0 reputation · 23 Aug 2023, 17:05 UTC
Goal: Determine whether a batch edit performed via the Plugin API is immediately reflected in subsequent REST API calls that fetch component variant nodes.
Constraints: The REST endpoint /v1/files/:file_id/nodes returns paginated data without a total count, and plugin‑initiated property changes are asynchronous. Current observations suggest a delay of up to several seconds under heavy load, but no guarantee of eventual consistency is documented.
Uncertainty: When a plugin performs a bulk text update on 50 variants, how long does it take before a REST fetch of those variant nodes returns the updated values? Does the pagination mechanism hide latency spikes that would otherwise be observable?
Specific questions:
No. A batch edit performed via the Figma Plugin API is not guaranteed to be immediately visible in a subsequent REST API call to /v1/files/:file_id/nodes. Reads via REST are eventually consistent with plugin writes under typical production load.
Confirmed facts:
Likely explanation:
The REST API does not provide a signal such as a timestamp or version field on nodes that indicates when data is fully synchronized with plugin changes. Clients must compare property values rather than rely on a sync signal.
Pagination parameters, page size and cursor, affect request latency and sampling granularity. Smaller pages increase request count and can make per-page latency variations more observable; larger pages increase per-request time. Pagination itself provides no consistency guarantee and cannot be relied upon to detect and quantify latency spikes as a consistency signal. Cursor progression does not guarantee all edits are visible.
Assumption and uncertainty: The several-seconds delay under heavy load is anecdotal, not an SLA. Current verification is required for your file and load profile.
One missing diagnostic detail that changes the recommendation: Do you have the exact node IDs for the 50 variants and a plugin-reported completion timestamp for the batch edit? Without both, polling cannot be correlated to the specific edit and you would need to widen the verification window.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.