I'm developing a Figma plugin that syncs library variables to local variables. I've noticed that when I call figma.teamLibrary.getAvailableLibraryVariableCollectionsAsync()
multiple times, it seems to return cached results rather than fetching fresh data from the library.
This is causing issues when I update variables in the library and then try to sync them again - my plugin doesn't see the updated variables because it's getting cached data.
Example scenario:
- I run my plugin and sync variables from a library
- I update variables in the library
- I run my plugin again, but it doesn't see the updated variables
Questions:
- Is there a way to force
getAvailableLibraryVariableCollectionsAsync()
to bypass the cache and get fresh data? - Is there a recommended approach for handling library variable updates in plugins?
- How long does this cache persist? Is it just for the current plugin session or longer?
- Are there any workarounds, like a different API method I should be using instead?
Any insights from the Figma team or other plugin developers would be greatly appreciated!