figma-plugin: Updated time verified not working while using Genreic Version Storage/JSONBIN
Describe the bug When using this plug-in for multi-person collaboration, I noticed that the plug-in does not remind us that there are conflicts in our changes. Even if the local data is older than the remote data, it can always be submitted and overwritten. In the end, we tested and determined that the logic of comparing local and remote update timestamps in the plugin source code did not work.
To Reproduce Steps to reproduce the behavior:
- Use JSONBin or Genreic Version Storage as sync method, People A & People B use same key.
- People A update his design token (Update on changes clicked)
- People B update his design token without syncing
- People A sync.
Expected behavior
People B should see warning like this:

Screenshots or Screencasts
In fact, B updated successfully like this:
and A found that his update overwritten.
Figma file (optional) Any Figma
JSON (optional) Any JSON
Point After checking source code we find:
rootState.uiState.lastUpdatedAt (tokenState.updateDocument)
-> lastUpdatedAt (updateTokensOnSources)
-> lastUpdatedAt (updateRemoteTokens)
-> oldUpdatedAt (updateGenericVersionedTokens)
-> compareUpdatedAt
It seems that rootUI.state.lastUpdatedAt never update after initialized as null, and
rootState.uiState.lastUpdatedAt ?? new Date().toISOString()
always go to fallback logic.
Other bugs
- Auto update never triggered since REMOVING/RENAMING tokens.
- Close the plugin then reopen it, sync connection losed, need to be reactived by update settings.
- PUT Request failed (404/500/400) without any notification while using Genreic Version Storage.
Suggestions
- Use data version instead of data updatedAt may be better, and ‘version/updatedAt’ need to be shown at plugin panel.
notifyToUIshould be triggered when any request failed, and its content should contain response.message.- GET request before PUT during retrieval need to be diffrenet from normal GET request (by send local updatedAt timestamp for server checking or other resolutions), because the first one may block the subsequent process, while second one always do sync logic successfully.
About this issue
- Original URL
- State: open
- Created a year ago
- Comments: 15 (2 by maintainers)
@kibbon I’ve updated my MR, is should now send an update to the server for deletion, renaming and duplication of token values, hopefully this will help as part of the way to resolving how to synchronize the states
Issue confirmed? @SorsOps @six7 cc