The data saving with figma.root.setPluginData in a branch will not be merged into main branch

I’m creating a plugin that saving data to the file with figma.root.setPluginData.
I noticed that I will lose new saved plugin data on a branch when I merge the branch.

Is this expected behavior?

Maybe, I can use figma.clientStorage instead, but I’d like to share the plugin data between some editors and review changes in the branch.

Memo: How to retrieve the “lost” data

  1. “See all branches”
  2. Open merged branch in “Archived”
  3. “Duplicate as new file”
  4. Run the plugin on the duplicated file.

I have observed similar behaviour when integrating offline changes. I guess this goes into the same direction - no response from the Figma team yet.

1 Like

I found that it happens setPluginData on figma.root, but doesn’t happen on a PageNode.

When I setPluginData on a PageNode then I can merge as I expected. Also, I can see the diff in the branch review window.

It may be one of the work-around. But if someone delete the node, the plugin data will be gone :frowning:

Thats an interesting observation - i will check if this applies to my sync issue as well.

1 Like