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

update isSameCredentials check to prefer internalId when available #3173

Merged
merged 1 commit into from
Oct 14, 2024

Conversation

six7
Copy link
Collaborator

@six7 six7 commented Oct 12, 2024

Why does this PR exist?

Closes #3069

Our check for if a sync provider is active was missing logic to compare the unique internalId when available for some sync providers. This PR elevates that to always check for those, if present. Also updates tests.

Note: The internalId was something that we added 2 years back now or so. So we should in most cases have it, it might just be the case for really old examples that we dont have it.

What does this pull request do?

  • Add tests
  • Update logic of uniqueness check

Testing this change

Add a Studio sync provider with two different API keys.
Old version = shows up twice
New version = active state shown properly

image

Copy link

changeset-bot bot commented Oct 12, 2024

🦋 Changeset detected

Latest commit: 6f75c8b

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

@six7 six7 mentioned this pull request Oct 12, 2024
5 tasks
Copy link
Contributor

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

Copy link
Contributor

Commit SHA:a962193ceaa2af78592a6b380bae8413cc0f865d

Test coverage results 🧪

Code coverage diff between base branch:main and head branch: fix/duplicate-storage-providers 
Status File % Stmts % Branch % Funcs % Lines
🟢 total 67.92 (0.01) 58.56 (0.09) 64.67 (0) 68.31 (0.02)
🟢 packages/tokens-studio-for-figma/src/utils/isSameCredentials.ts 100 (25) 96.29 (27.06) 100 (0) 100 (25)

@six7 six7 merged commit 80a5a92 into main Oct 14, 2024
11 checks passed
@six7 six7 deleted the fix/duplicate-storage-providers branch October 14, 2024 07:39
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