Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix duplicate display studio sync #3171

Closed
wants to merge 7 commits into from

Conversation

akshay-gupta7
Copy link
Contributor

Resolves #3069

Fixes an error where the Tokens Studio Sync Provider in the plugin was showing up twice.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • None of the above

How to test this

  • Go to Settings Tab
  • Click on Add New Sync Provider
  • Choose Tokens Studio(Beta)
  • Add API key and connection string
  • Click on Save
  • You should either see and error or a success. If you see an error, check your keys and click on save again. If successful, the Tokens Studio Sync provider should no show up only once in the list of sync providers

Screenshots or video (if necessary):

@akshay-gupta7 akshay-gupta7 self-assigned this Oct 10, 2024
Copy link

changeset-bot bot commented Oct 10, 2024

🦋 Changeset detected

Latest commit: 015ff32

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@tokens-studio/figma-plugin Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

github-actions bot commented Oct 10, 2024

⤵️ 📦 ✨ The artifact was successfully created! Want to test it? Download it here 👀 🎁

Copy link
Contributor

github-actions bot commented Oct 10, 2024

Commit SHA:d9caba4841c614202bad7ddf299a7ed81b3c497a

Test coverage results 🧪

Code coverage diff between base branch:main and head branch: fix-duplicate-display-studio-sync 
Status File % Stmts % Branch % Funcs % Lines
🟢 total 67.92 (0.01) 58.48 (0.01) 64.7 (0.03) 68.31 (0.02)
🔴 packages/tokens-studio-for-figma/src/app/components/SyncSettings.tsx 91.66 (-2.93) 83.33 (-8.33) 85.71 (2.38) 91.48 (-2.96)

Copy link
Contributor

github-actions bot commented Oct 10, 2024

Commit SHA:d9caba4841c614202bad7ddf299a7ed81b3c497a
Current PR reduces the test coverage percentage by 1 for some tests

Copy link
Collaborator

@six7 six7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesnt fix the issue for already duplicative registered providers. Also, the issue mentions this also happens for other sync providers such as Supernova, can you check that as well?

@six7
Copy link
Collaborator

six7 commented Oct 12, 2024

I'll be closing this in favor of #3173

Reasoning: Doing a uniqueness check on useEffect is an anti-pattern. We should always clean our data when we retrieve it. In our case, we already had a uniqueness check, but it was just not executed properly for some sync providers. In the case of Studio we always just compared the URL, never incldued the api key. In Supernova case, we didnt include the mapping. This now changes that, but also ALWAYS prefers the unique id.

@six7 six7 closed this Oct 12, 2024
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.

Sync: Plugin is showing connection twice
2 participants