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

How to disable cache #890

Closed
LijuanZ opened this issue May 25, 2018 · 10 comments
Closed

How to disable cache #890

LijuanZ opened this issue May 25, 2018 · 10 comments
Assignees

Comments

@LijuanZ
Copy link

LijuanZ commented May 25, 2018

Hello, I'm using octokit in my node.js SPA and have trouble to disable cache in the requests.

I tried to get the whole branch list and then create a new branch and fetch branch list again in one of my work flows and these requests happen in less than 1min. The new branch does not exist in my second call of fetching branch list because browser cached the results. I find there is header of Cache-Control: public, max-age=60, s-maxage=60 in the response and believe this is the cause. It works fine if I disable cache in my browser or slow down the work flow to take more than 1min.

I've tried set Cache-Control header in my request to disable cache but failed because of error "Request header field cache-control is not allowed by Access-Control-Allow-Headers in preflight response."

Is there a way to force octokit to make the request no matter there is cache or not?

Thanks!

@gr2m
Copy link
Contributor

gr2m commented May 25, 2018

Hi @LijuanZ thanks for opening the issue!

I’m out right now and can’t help much, but you can pass custom headers to every method, maybe try to pass a header that prevents caching, I thing GitHub’s Rest API docs have some info on that. I’ll have a look tomorrow if you are still stuck on it

@LijuanZ
Copy link
Author

LijuanZ commented May 25, 2018

Hi @gr2m I'm still stuck...Didn't find any cache related custom header in API docs or maybe I'm looking at wrong place. Can you help take a look when have time?

Thanks!

@gr2m
Copy link
Contributor

gr2m commented May 25, 2018

Okay I'm on it

@gr2m gr2m self-assigned this May 25, 2018
@gr2m
Copy link
Contributor

gr2m commented May 25, 2018

is your code public somewhere?

@LijuanZ
Copy link
Author

LijuanZ commented May 25, 2018

No it's not public. But basically it calls octokit.repos.getBranches(callContext) to get branch list, and then octokit.gitdata.createReference(callContext) to create new branch, and then calls octokit.repos.getBranches(callContext) again. All these requests are from my client side code.

The new branch is created successfully but the second getBranches call doesn't have it because browser reads it from cache.

@gr2m
Copy link
Contributor

gr2m commented May 25, 2018

Usually one would do something like this

  await client.repos.getBranches({
    owner: 'gr2m',
    repo: 'sandbox',
    headers: {
      'cache-control': 'no-cache'
    }
  })

But turns out that header is not allowed for cross origin requests. You will see an error like this:

image

I’ll check on that with the AP team. For the time being you can use the If-None-Match header as described here: https://developer.github.com/v3/#conditional-requests. If you leave the value empty then it will never match and the server will never return a cached response:

  const {data: branches2} = await client.repos.getBranches({
    owner: 'gr2m',
    repo: 'sandbox',
    headers: {
      'If-None-Match': ''
    }
  })

Does that work for you?

@gr2m gr2m added the question label May 25, 2018
@LijuanZ
Copy link
Author

LijuanZ commented May 25, 2018

Yeah, cache-control header was my first attempt but failed on preflight. If-None-Match header with empty eTag does the trick for me! Thank you very much for the help!

@gr2m
Copy link
Contributor

gr2m commented May 25, 2018

Thanks for checking it, glad it works now. Feel free to add comments if you have any follow up questions :)

@gr2m gr2m closed this as completed May 25, 2018
@mddanishyusuf
Copy link

@gr2m Thanks for the solution. It's saved my day. :)

Yes, 'If-None-Match': '' is worked.

0mnius pushed a commit to deuceseven/automerge-action that referenced this issue Dec 8, 2021
LiamMartens added a commit to tokens-studio/figma-plugin that referenced this issue Jun 23, 2022
LiamMartens added a commit to tokens-studio/figma-plugin that referenced this issue Jun 23, 2022
six7 pushed a commit to tokens-studio/figma-plugin that referenced this issue Jun 23, 2022
* feat: Allow root folder in Git storage

* fix: Fixed subfolder

* chore: Updated tests

* chore: Updated test coverage

* fix: FT-320 fixed subfolders for Gitlab

* fix: Fixed Gitlab push in subfolders

* fix: Fixed Github cache
octokit/octokit.js#890

* fix: Update tests
MightyDevKnight pushed a commit to tokens-studio/figma-plugin that referenced this issue Jun 30, 2022
* feat: Allow root folder in Git storage

* fix: Fixed subfolder

* chore: Updated tests

* chore: Updated test coverage

* fix: FT-320 fixed subfolders for Gitlab

* fix: Fixed Gitlab push in subfolders

* fix: Fixed Github cache
octokit/octokit.js#890

* fix: Update tests
MightyDevKnight pushed a commit to tokens-studio/figma-plugin that referenced this issue Jun 30, 2022
* feat: Allow root folder in Git storage

* fix: Fixed subfolder

* chore: Updated tests

* chore: Updated test coverage

* fix: FT-320 fixed subfolders for Gitlab

* fix: Fixed Gitlab push in subfolders

* fix: Fixed Github cache
octokit/octokit.js#890

* fix: Update tests
MightyDevKnight pushed a commit to tokens-studio/figma-plugin that referenced this issue Jun 30, 2022
* feat: Allow root folder in Git storage

* fix: Fixed subfolder

* chore: Updated tests

* chore: Updated test coverage

* fix: FT-320 fixed subfolders for Gitlab

* fix: Fixed Gitlab push in subfolders

* fix: Fixed Github cache
octokit/octokit.js#890

* fix: Update tests
six7 added a commit to tokens-studio/figma-plugin that referenced this issue Jul 8, 2022
* Add license key tests

* Add autocomplete to composition tokens (#919)

* skip to start screen when create new file

* resolve test error

* add env

* convert input to DownShiftInput in compositionToken

* modify css

* add color picker

* delete color picker

Co-authored-by: hiroshi <robinhoodie0823@gmail.com>

* Allow root folder git (#902)

* feat: Allow root folder in Git storage

* fix: Fixed subfolder

* chore: Updated tests

* chore: Updated test coverage

* fix: FT-320 fixed subfolders for Gitlab

* fix: Fixed Gitlab push in subfolders

* fix: Fixed Github cache
octokit/octokit.js#890

* fix: Update tests

* Apply border width to specific sides left top right bottom (#925)

* Add border width to specific sides

* remove logs

* wip:

* fix transformer references (#932)

* added expected output

* add composition examples

* fix tests

* Fix composition tokens - resolveReferences: flag

Co-authored-by: razvanpop <rop_pazvan@yahoo.com>

* Tests add cypress test for creating composition tokens (#935)

* skip to start screen when create new file

* resolve test error

* add env

* select composition token

* add cypress test for composition token

* code refresh

* fix: composition token cypress

Co-authored-by: hiroshi <robinhoodie0823@gmail.com>

* bump release of token-transformer

* Create missing tests for src utils alias (#808)

* add test for tokentooltipcontent

* remove usedTokens test

* Fix/ado (#789)

* fix check for ado

* fix: Fixed ADO sync

Co-authored-by: Liam Martens <hi@liammartens.com>

* Fix validate calls (#793)

* Fix license validation calls & flags

* Fix tests Initiator

* feat: add tests for URLTokenStorage (#794)

* Bug un applying a token no longer removes token (#791)

* skip to start screen when create new file

* resolve test error

* add env

* check not unapplying tokens

* get pluginValues from findNodesWithData

* check compositionToken unapply error

* fix: remove property when unapplying composition token

Co-authored-by: hiroshi <robinhoodie0823@gmail.com>

* fix type error

* value test

* add alias test

* remove tokentooltipcontent

* add test files

* add contain alias test

* add #value

* merge into one

* Create jest.yml

* Delete jest.yml

* Update node.js.yml

* Add jest coverage (#816)

* add coverage

* remove mock

* fx command

* add coverage option and github_token

* resolve conflict

* add test cases and fix bugs

* fix bug with commit

* resolve conflict

* resolve conflict

* fix test case statement

* install deps

* fix tests for tooltips

* fix alias test

* update test for alias

* fix alias contain test

Co-authored-by: Jan Six <six.jan@gmail.com>
Co-authored-by: Liam Martens <hi@liammartens.com>
Co-authored-by: Razvan <rop_pazvan@yahoo.com>
Co-authored-by: SwordEdge <yamadera46@hotmail.com>
Co-authored-by: hiroshi <robinhoodie0823@gmail.com>

* wip: Implement tests

* Ft 103 add ability to import a local file json and a folder (#926)

* Ft 253 tests add cypress test for using the branch switcher (#936)

* wip: Mocking AsyncMessageChannel to work

* fix scrollbar color (#946)

* Multi file sync handle set deletions (#915)

* skip to start screen when create new file

* resolve test error

* add env

* github multifile deletiong and rename

* gitlab multisync deletion & rename

* adomultifile sync deletion and rename

* fix: gitlab remove all files

* modify multifileSchema

* modify test coverage

* fix: reading directory

* fix: adoTokenStorage test coverage

* gitHubTokenStoragetest

* modify writeChangeSet on ado snyc

* remove cache

* modify test coverage fro adoTokenStorage

* add test coverage for delete & rename multi file github sync

* add test coverage for rename delete gitlab multi sync

* add test coverage for delete & rename for add multi sync

* add test coverage for gitHubTokenStorage

* add test coverage when there is no tree on github sync

Co-authored-by: hiroshi <robinhoodie0823@gmail.com>
Co-authored-by: Jan Six <six.jan@gmail.com>

* feat: Implement working startup logic tests based on actual logic

* feat: Added startup tests with and without license

* fix: Fixed build - cleaning up lockfile

* fix: Increase test coverage

* fix: Fixed build somehow

* Ft 272 gh unable to remove tokens from multiple parent component variants at once (#949)

* Ft 250 tests add cypress test for creating typography boxshadow tokens that reference typography boxshadow tokens (#941)

* Ft 251 tests add cypress test for creating themes based on token sets (#911)

* Losing scroll collapse on switching between tokens sets or main nav tabs (#943)

* skip to start screen when create new file

* resolve test error

* add env

* save collapsedTokenSet in the tokenState

* add collapsedTokenTypeObj to save collapse token type

* add scrollPosition to save scroll position

* remove document.getElementById

* code refresh

* rename function name

* resolve test error

* code review

Co-authored-by: hiroshi <robinhoodie0823@gmail.com>

* fix issue url sync provider gets duplicated on edit (#954)

* move coverage to its own step (#960)

* Ft 271 create test for unrecognized token values (#956)

* Ft 341 gh composition tokens dont pick up values of 0 (#955)

* Ft 340 bugfix branch switch menu scroll doesnt work (#953)

* chore: Updated with PR feedback

* fix: Fixed tests

* fix: scroll color on branchselector

* Documentation value token for 0 cannot be applied (#963)

* skip to start screen when create new file

* resolve test error

* add env

* fix: set documentation value zero

Co-authored-by: hiroshi <robinhoodie0823@gmail.com>

* Read pro features in free (#939)

* add themes dropdown to free users

* add pro badge to branch selector

* remove pro condition to read multi file sync

* make probadge functional

* fix git access when multifile was disabled

* fix tests

* fix test, coverage

* add more tests

* add feature flags to checkandsetaccess

* fix tests

* build(deps): bump shell-quote from 1.7.2 to 1.7.3 (#924)

* fix minor issues with next branch (#967)

* fix minor issues with next branch

* add rc to version

* fix set values on node (#975)

* fix set values on node for text layers

* remove log

* merge tests

* fixes coverage action (#973)

* 982 112rc2 composition token autocomplete doesnt autosuggest border tokens for new individual stroke widths (#987)

* skip to start screen when create new file

* resolve test error

* add env

* choose borderWidth when selecting borderWidthTop

Co-authored-by: hiroshi <robinhoodie0823@gmail.com>

* fix: token sets show as list for free users even when using multi file sync (#983)

* fix set list showing up as list for free-users when using MFS

* bump version

* Add cypress test for using the multi inspector incl remap functionality (#986)

* skip to start screen when create new file

* resolve test error

* add env

* add default tokens

* display applied token on inspector

* remap token

* code refresh

* remove console

* Update cypress/integration/inspector.spec.js

Co-authored-by: hiroshi <robinhoodie0823@gmail.com>
Co-authored-by: Jan Six <six.jan@gmail.com>

* ADO sync tokens are being pulled from main instead of the current branch (#971)

* skip to start screen when create new file

* resolve test error

* add env

* fix: sync with ado from current branch

Co-authored-by: hiroshi <robinhoodie0823@gmail.com>
Co-authored-by: Jan Six <six.jan@gmail.com>

* bump release

Co-authored-by: razvanpop <rop_pazvan@yahoo.com>
Co-authored-by: SwordEdge <yamadera46@hotmail.com>
Co-authored-by: hiroshi <robinhoodie0823@gmail.com>
Co-authored-by: Liam Martens <hi@liammartens.com>
Co-authored-by: MightyDevKnight <102773603+MightyDevKnight@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
six7 added a commit to tokens-studio/figma-plugin that referenced this issue Jul 8, 2022
* Add license key tests

* Add autocomplete to composition tokens (#919)

* skip to start screen when create new file

* resolve test error

* add env

* convert input to DownShiftInput in compositionToken

* modify css

* add color picker

* delete color picker

Co-authored-by: hiroshi <robinhoodie0823@gmail.com>

* Allow root folder git (#902)

* feat: Allow root folder in Git storage

* fix: Fixed subfolder

* chore: Updated tests

* chore: Updated test coverage

* fix: FT-320 fixed subfolders for Gitlab

* fix: Fixed Gitlab push in subfolders

* fix: Fixed Github cache
octokit/octokit.js#890

* fix: Update tests

* Apply border width to specific sides left top right bottom (#925)

* Add border width to specific sides

* remove logs

* wip:

* fix transformer references (#932)

* added expected output

* add composition examples

* fix tests

* Fix composition tokens - resolveReferences: flag

Co-authored-by: razvanpop <rop_pazvan@yahoo.com>

* Tests add cypress test for creating composition tokens (#935)

* skip to start screen when create new file

* resolve test error

* add env

* select composition token

* add cypress test for composition token

* code refresh

* fix: composition token cypress

Co-authored-by: hiroshi <robinhoodie0823@gmail.com>

* bump release of token-transformer

* Create missing tests for src utils alias (#808)

* add test for tokentooltipcontent

* remove usedTokens test

* Fix/ado (#789)

* fix check for ado

* fix: Fixed ADO sync

Co-authored-by: Liam Martens <hi@liammartens.com>

* Fix validate calls (#793)

* Fix license validation calls & flags

* Fix tests Initiator

* feat: add tests for URLTokenStorage (#794)

* Bug un applying a token no longer removes token (#791)

* skip to start screen when create new file

* resolve test error

* add env

* check not unapplying tokens

* get pluginValues from findNodesWithData

* check compositionToken unapply error

* fix: remove property when unapplying composition token

Co-authored-by: hiroshi <robinhoodie0823@gmail.com>

* fix type error

* value test

* add alias test

* remove tokentooltipcontent

* add test files

* add contain alias test

* add #value

* merge into one

* Create jest.yml

* Delete jest.yml

* Update node.js.yml

* Add jest coverage (#816)

* add coverage

* remove mock

* fx command

* add coverage option and github_token

* resolve conflict

* add test cases and fix bugs

* fix bug with commit

* resolve conflict

* resolve conflict

* fix test case statement

* install deps

* fix tests for tooltips

* fix alias test

* update test for alias

* fix alias contain test

Co-authored-by: Jan Six <six.jan@gmail.com>
Co-authored-by: Liam Martens <hi@liammartens.com>
Co-authored-by: Razvan <rop_pazvan@yahoo.com>
Co-authored-by: SwordEdge <yamadera46@hotmail.com>
Co-authored-by: hiroshi <robinhoodie0823@gmail.com>

* wip: Implement tests

* Ft 103 add ability to import a local file json and a folder (#926)

* Ft 253 tests add cypress test for using the branch switcher (#936)

* wip: Mocking AsyncMessageChannel to work

* fix scrollbar color (#946)

* Multi file sync handle set deletions (#915)

* skip to start screen when create new file

* resolve test error

* add env

* github multifile deletiong and rename

* gitlab multisync deletion & rename

* adomultifile sync deletion and rename

* fix: gitlab remove all files

* modify multifileSchema

* modify test coverage

* fix: reading directory

* fix: adoTokenStorage test coverage

* gitHubTokenStoragetest

* modify writeChangeSet on ado snyc

* remove cache

* modify test coverage fro adoTokenStorage

* add test coverage for delete & rename multi file github sync

* add test coverage for rename delete gitlab multi sync

* add test coverage for delete & rename for add multi sync

* add test coverage for gitHubTokenStorage

* add test coverage when there is no tree on github sync

Co-authored-by: hiroshi <robinhoodie0823@gmail.com>
Co-authored-by: Jan Six <six.jan@gmail.com>

* feat: Implement working startup logic tests based on actual logic

* feat: Added startup tests with and without license

* fix: Fixed build - cleaning up lockfile

* fix: Increase test coverage

* fix: Fixed build somehow

* Ft 272 gh unable to remove tokens from multiple parent component variants at once (#949)

* Ft 250 tests add cypress test for creating typography boxshadow tokens that reference typography boxshadow tokens (#941)

* Ft 251 tests add cypress test for creating themes based on token sets (#911)

* Losing scroll collapse on switching between tokens sets or main nav tabs (#943)

* skip to start screen when create new file

* resolve test error

* add env

* save collapsedTokenSet in the tokenState

* add collapsedTokenTypeObj to save collapse token type

* add scrollPosition to save scroll position

* remove document.getElementById

* code refresh

* rename function name

* resolve test error

* code review

Co-authored-by: hiroshi <robinhoodie0823@gmail.com>

* fix issue url sync provider gets duplicated on edit (#954)

* move coverage to its own step (#960)

* Ft 271 create test for unrecognized token values (#956)

* Ft 341 gh composition tokens dont pick up values of 0 (#955)

* Ft 340 bugfix branch switch menu scroll doesnt work (#953)

* chore: Updated with PR feedback

* fix: Fixed tests

* fix: scroll color on branchselector

* Documentation value token for 0 cannot be applied (#963)

* skip to start screen when create new file

* resolve test error

* add env

* fix: set documentation value zero

Co-authored-by: hiroshi <robinhoodie0823@gmail.com>

* Read pro features in free (#939)

* add themes dropdown to free users

* add pro badge to branch selector

* remove pro condition to read multi file sync

* make probadge functional

* fix git access when multifile was disabled

* fix tests

* fix test, coverage

* add more tests

* add feature flags to checkandsetaccess

* fix tests

* build(deps): bump shell-quote from 1.7.2 to 1.7.3 (#924)

* fix minor issues with next branch (#967)

* fix minor issues with next branch

* add rc to version

* fix set values on node (#975)

* fix set values on node for text layers

* remove log

* merge tests

* fixes coverage action (#973)

* 982 112rc2 composition token autocomplete doesnt autosuggest border tokens for new individual stroke widths (#987)

* skip to start screen when create new file

* resolve test error

* add env

* choose borderWidth when selecting borderWidthTop

Co-authored-by: hiroshi <robinhoodie0823@gmail.com>

* fix: token sets show as list for free users even when using multi file sync (#983)

* fix set list showing up as list for free-users when using MFS

* bump version

* Add cypress test for using the multi inspector incl remap functionality (#986)

* skip to start screen when create new file

* resolve test error

* add env

* add default tokens

* display applied token on inspector

* remap token

* code refresh

* remove console

* Update cypress/integration/inspector.spec.js

Co-authored-by: hiroshi <robinhoodie0823@gmail.com>
Co-authored-by: Jan Six <six.jan@gmail.com>

* add sentry config

update md

* adjust config

* adjust yarn file

* ADO sync tokens are being pulled from main instead of the current branch (#971)

* skip to start screen when create new file

* resolve test error

* add env

* fix: sync with ado from current branch

Co-authored-by: hiroshi <robinhoodie0823@gmail.com>
Co-authored-by: Jan Six <six.jan@gmail.com>

* remove sentryplugin

* adjust script

Co-authored-by: razvanpop <rop_pazvan@yahoo.com>
Co-authored-by: SwordEdge <yamadera46@hotmail.com>
Co-authored-by: hiroshi <robinhoodie0823@gmail.com>
Co-authored-by: Liam Martens <hi@liammartens.com>
Co-authored-by: MightyDevKnight <102773603+MightyDevKnight@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
six7 pushed a commit to tokens-studio/figma-plugin that referenced this issue Jul 17, 2022
* feat: Save sort order for multifile tokens

* feat: Implemented sorting of token sets for multifile sync

* fix: Fixed Github cache
octokit/octokit.js#890

* chore: Update tests

* chore: Increase test coverage

* chore: Updated coverage

* chore: Update coverage

* chore: yarn.lock

* fix: Check for array when applying sorting order from metadata file

* fix: Fixed sorting order not being respected for multifile sync when restoring last synced state

* fix: Fixed multifile sync sorting

* fix: Fixed tests

* feat: Implemented UI for multifile sorting

* chore: lockfile

* chore: Increase coverage

* fix: Fixed build

* chore: update test coverage

* chore: Update test coverage

* chore: Improved coverage

* chore: Coverage

* chore: Minor coverage increase

* chore: Fix bug with reordering in tree and fix tests

* fix: Fixed issue with collapsed groups
@kabalage
Copy link

kabalage commented Dec 3, 2022

I found, that fetch accepts a cache parameter in options that overrides how the browser will use the cache for the request: https://developer.mozilla.org/en-US/docs/Web/API/fetch#cache

@octokit/request.js accepts a request object in options that's getting passed to fetch as options:
https://github.com/octokit/request.js/blob/v6.2.2/src/fetch-wrapper.ts#L45

This is my solution to bypass the cache in my case (I'm using @octokit/request.js directly, but I believe this should work with the higher level wrappers as well) :

request('GET /user/installations', {
  headers: {
    authorization: `Bearer ${user.token}`
  },
  request: {
    cache: bypassCache ? 'reload' : 'default'
  }
});

Sandking1123 added a commit to Sandking1123/figma-tokens that referenced this issue Nov 4, 2023
* feat: Allow root folder in Git storage

* fix: Fixed subfolder

* chore: Updated tests

* chore: Updated test coverage

* fix: FT-320 fixed subfolders for Gitlab

* fix: Fixed Gitlab push in subfolders

* fix: Fixed Github cache
octokit/octokit.js#890

* fix: Update tests
Sandking1123 added a commit to Sandking1123/figma-tokens that referenced this issue Nov 4, 2023
* Add license key tests

* Add autocomplete to composition tokens (#919)

* skip to start screen when create new file

* resolve test error

* add env

* convert input to DownShiftInput in compositionToken

* modify css

* add color picker

* delete color picker

Co-authored-by: hiroshi <robinhoodie0823@gmail.com>

* Allow root folder git (#902)

* feat: Allow root folder in Git storage

* fix: Fixed subfolder

* chore: Updated tests

* chore: Updated test coverage

* fix: FT-320 fixed subfolders for Gitlab

* fix: Fixed Gitlab push in subfolders

* fix: Fixed Github cache
octokit/octokit.js#890

* fix: Update tests

* Apply border width to specific sides left top right bottom (#925)

* Add border width to specific sides

* remove logs

* wip:

* fix transformer references (#932)

* added expected output

* add composition examples

* fix tests

* Fix composition tokens - resolveReferences: flag

Co-authored-by: razvanpop <rop_pazvan@yahoo.com>

* Tests add cypress test for creating composition tokens (#935)

* skip to start screen when create new file

* resolve test error

* add env

* select composition token

* add cypress test for composition token

* code refresh

* fix: composition token cypress

Co-authored-by: hiroshi <robinhoodie0823@gmail.com>

* bump release of token-transformer

* Create missing tests for src utils alias (#808)

* add test for tokentooltipcontent

* remove usedTokens test

* Fix/ado (#789)

* fix check for ado

* fix: Fixed ADO sync

Co-authored-by: Liam Martens <hi@liammartens.com>

* Fix validate calls (#793)

* Fix license validation calls & flags

* Fix tests Initiator

* feat: add tests for URLTokenStorage (#794)

* Bug un applying a token no longer removes token (#791)

* skip to start screen when create new file

* resolve test error

* add env

* check not unapplying tokens

* get pluginValues from findNodesWithData

* check compositionToken unapply error

* fix: remove property when unapplying composition token

Co-authored-by: hiroshi <robinhoodie0823@gmail.com>

* fix type error

* value test

* add alias test

* remove tokentooltipcontent

* add test files

* add contain alias test

* add #value

* merge into one

* Create jest.yml

* Delete jest.yml

* Update node.js.yml

* Add jest coverage (#816)

* add coverage

* remove mock

* fx command

* add coverage option and github_token

* resolve conflict

* add test cases and fix bugs

* fix bug with commit

* resolve conflict

* resolve conflict

* fix test case statement

* install deps

* fix tests for tooltips

* fix alias test

* update test for alias

* fix alias contain test

Co-authored-by: Jan Six <six.jan@gmail.com>
Co-authored-by: Liam Martens <hi@liammartens.com>
Co-authored-by: Razvan <rop_pazvan@yahoo.com>
Co-authored-by: SwordEdge <yamadera46@hotmail.com>
Co-authored-by: hiroshi <robinhoodie0823@gmail.com>

* wip: Implement tests

* Ft 103 add ability to import a local file json and a folder (#926)

* Ft 253 tests add cypress test for using the branch switcher (#936)

* wip: Mocking AsyncMessageChannel to work

* fix scrollbar color (#946)

* Multi file sync handle set deletions (#915)

* skip to start screen when create new file

* resolve test error

* add env

* github multifile deletiong and rename

* gitlab multisync deletion & rename

* adomultifile sync deletion and rename

* fix: gitlab remove all files

* modify multifileSchema

* modify test coverage

* fix: reading directory

* fix: adoTokenStorage test coverage

* gitHubTokenStoragetest

* modify writeChangeSet on ado snyc

* remove cache

* modify test coverage fro adoTokenStorage

* add test coverage for delete & rename multi file github sync

* add test coverage for rename delete gitlab multi sync

* add test coverage for delete & rename for add multi sync

* add test coverage for gitHubTokenStorage

* add test coverage when there is no tree on github sync

Co-authored-by: hiroshi <robinhoodie0823@gmail.com>
Co-authored-by: Jan Six <six.jan@gmail.com>

* feat: Implement working startup logic tests based on actual logic

* feat: Added startup tests with and without license

* fix: Fixed build - cleaning up lockfile

* fix: Increase test coverage

* fix: Fixed build somehow

* Ft 272 gh unable to remove tokens from multiple parent component variants at once (#949)

* Ft 250 tests add cypress test for creating typography boxshadow tokens that reference typography boxshadow tokens (#941)

* Ft 251 tests add cypress test for creating themes based on token sets (#911)

* Losing scroll collapse on switching between tokens sets or main nav tabs (#943)

* skip to start screen when create new file

* resolve test error

* add env

* save collapsedTokenSet in the tokenState

* add collapsedTokenTypeObj to save collapse token type

* add scrollPosition to save scroll position

* remove document.getElementById

* code refresh

* rename function name

* resolve test error

* code review

Co-authored-by: hiroshi <robinhoodie0823@gmail.com>

* fix issue url sync provider gets duplicated on edit (#954)

* move coverage to its own step (#960)

* Ft 271 create test for unrecognized token values (#956)

* Ft 341 gh composition tokens dont pick up values of 0 (#955)

* Ft 340 bugfix branch switch menu scroll doesnt work (#953)

* chore: Updated with PR feedback

* fix: Fixed tests

* fix: scroll color on branchselector

* Documentation value token for 0 cannot be applied (#963)

* skip to start screen when create new file

* resolve test error

* add env

* fix: set documentation value zero

Co-authored-by: hiroshi <robinhoodie0823@gmail.com>

* Read pro features in free (#939)

* add themes dropdown to free users

* add pro badge to branch selector

* remove pro condition to read multi file sync

* make probadge functional

* fix git access when multifile was disabled

* fix tests

* fix test, coverage

* add more tests

* add feature flags to checkandsetaccess

* fix tests

* build(deps): bump shell-quote from 1.7.2 to 1.7.3 (#924)

* fix minor issues with next branch (#967)

* fix minor issues with next branch

* add rc to version

* fix set values on node (#975)

* fix set values on node for text layers

* remove log

* merge tests

* fixes coverage action (#973)

* 982 112rc2 composition token autocomplete doesnt autosuggest border tokens for new individual stroke widths (#987)

* skip to start screen when create new file

* resolve test error

* add env

* choose borderWidth when selecting borderWidthTop

Co-authored-by: hiroshi <robinhoodie0823@gmail.com>

* fix: token sets show as list for free users even when using multi file sync (#983)

* fix set list showing up as list for free-users when using MFS

* bump version

* Add cypress test for using the multi inspector incl remap functionality (#986)

* skip to start screen when create new file

* resolve test error

* add env

* add default tokens

* display applied token on inspector

* remap token

* code refresh

* remove console

* Update cypress/integration/inspector.spec.js

Co-authored-by: hiroshi <robinhoodie0823@gmail.com>
Co-authored-by: Jan Six <six.jan@gmail.com>

* ADO sync tokens are being pulled from main instead of the current branch (#971)

* skip to start screen when create new file

* resolve test error

* add env

* fix: sync with ado from current branch

Co-authored-by: hiroshi <robinhoodie0823@gmail.com>
Co-authored-by: Jan Six <six.jan@gmail.com>

* bump release

Co-authored-by: razvanpop <rop_pazvan@yahoo.com>
Co-authored-by: SwordEdge <yamadera46@hotmail.com>
Co-authored-by: hiroshi <robinhoodie0823@gmail.com>
Co-authored-by: Liam Martens <hi@liammartens.com>
Co-authored-by: MightyDevKnight <102773603+MightyDevKnight@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sandking1123 added a commit to Sandking1123/figma-tokens that referenced this issue Nov 4, 2023
* Add license key tests

* Add autocomplete to composition tokens (#919)

* skip to start screen when create new file

* resolve test error

* add env

* convert input to DownShiftInput in compositionToken

* modify css

* add color picker

* delete color picker

Co-authored-by: hiroshi <robinhoodie0823@gmail.com>

* Allow root folder git (#902)

* feat: Allow root folder in Git storage

* fix: Fixed subfolder

* chore: Updated tests

* chore: Updated test coverage

* fix: FT-320 fixed subfolders for Gitlab

* fix: Fixed Gitlab push in subfolders

* fix: Fixed Github cache
octokit/octokit.js#890

* fix: Update tests

* Apply border width to specific sides left top right bottom (#925)

* Add border width to specific sides

* remove logs

* wip:

* fix transformer references (#932)

* added expected output

* add composition examples

* fix tests

* Fix composition tokens - resolveReferences: flag

Co-authored-by: razvanpop <rop_pazvan@yahoo.com>

* Tests add cypress test for creating composition tokens (#935)

* skip to start screen when create new file

* resolve test error

* add env

* select composition token

* add cypress test for composition token

* code refresh

* fix: composition token cypress

Co-authored-by: hiroshi <robinhoodie0823@gmail.com>

* bump release of token-transformer

* Create missing tests for src utils alias (#808)

* add test for tokentooltipcontent

* remove usedTokens test

* Fix/ado (#789)

* fix check for ado

* fix: Fixed ADO sync

Co-authored-by: Liam Martens <hi@liammartens.com>

* Fix validate calls (#793)

* Fix license validation calls & flags

* Fix tests Initiator

* feat: add tests for URLTokenStorage (#794)

* Bug un applying a token no longer removes token (#791)

* skip to start screen when create new file

* resolve test error

* add env

* check not unapplying tokens

* get pluginValues from findNodesWithData

* check compositionToken unapply error

* fix: remove property when unapplying composition token

Co-authored-by: hiroshi <robinhoodie0823@gmail.com>

* fix type error

* value test

* add alias test

* remove tokentooltipcontent

* add test files

* add contain alias test

* add #value

* merge into one

* Create jest.yml

* Delete jest.yml

* Update node.js.yml

* Add jest coverage (#816)

* add coverage

* remove mock

* fx command

* add coverage option and github_token

* resolve conflict

* add test cases and fix bugs

* fix bug with commit

* resolve conflict

* resolve conflict

* fix test case statement

* install deps

* fix tests for tooltips

* fix alias test

* update test for alias

* fix alias contain test

Co-authored-by: Jan Six <six.jan@gmail.com>
Co-authored-by: Liam Martens <hi@liammartens.com>
Co-authored-by: Razvan <rop_pazvan@yahoo.com>
Co-authored-by: SwordEdge <yamadera46@hotmail.com>
Co-authored-by: hiroshi <robinhoodie0823@gmail.com>

* wip: Implement tests

* Ft 103 add ability to import a local file json and a folder (#926)

* Ft 253 tests add cypress test for using the branch switcher (#936)

* wip: Mocking AsyncMessageChannel to work

* fix scrollbar color (#946)

* Multi file sync handle set deletions (#915)

* skip to start screen when create new file

* resolve test error

* add env

* github multifile deletiong and rename

* gitlab multisync deletion & rename

* adomultifile sync deletion and rename

* fix: gitlab remove all files

* modify multifileSchema

* modify test coverage

* fix: reading directory

* fix: adoTokenStorage test coverage

* gitHubTokenStoragetest

* modify writeChangeSet on ado snyc

* remove cache

* modify test coverage fro adoTokenStorage

* add test coverage for delete & rename multi file github sync

* add test coverage for rename delete gitlab multi sync

* add test coverage for delete & rename for add multi sync

* add test coverage for gitHubTokenStorage

* add test coverage when there is no tree on github sync

Co-authored-by: hiroshi <robinhoodie0823@gmail.com>
Co-authored-by: Jan Six <six.jan@gmail.com>

* feat: Implement working startup logic tests based on actual logic

* feat: Added startup tests with and without license

* fix: Fixed build - cleaning up lockfile

* fix: Increase test coverage

* fix: Fixed build somehow

* Ft 272 gh unable to remove tokens from multiple parent component variants at once (#949)

* Ft 250 tests add cypress test for creating typography boxshadow tokens that reference typography boxshadow tokens (#941)

* Ft 251 tests add cypress test for creating themes based on token sets (#911)

* Losing scroll collapse on switching between tokens sets or main nav tabs (#943)

* skip to start screen when create new file

* resolve test error

* add env

* save collapsedTokenSet in the tokenState

* add collapsedTokenTypeObj to save collapse token type

* add scrollPosition to save scroll position

* remove document.getElementById

* code refresh

* rename function name

* resolve test error

* code review

Co-authored-by: hiroshi <robinhoodie0823@gmail.com>

* fix issue url sync provider gets duplicated on edit (#954)

* move coverage to its own step (#960)

* Ft 271 create test for unrecognized token values (#956)

* Ft 341 gh composition tokens dont pick up values of 0 (#955)

* Ft 340 bugfix branch switch menu scroll doesnt work (#953)

* chore: Updated with PR feedback

* fix: Fixed tests

* fix: scroll color on branchselector

* Documentation value token for 0 cannot be applied (#963)

* skip to start screen when create new file

* resolve test error

* add env

* fix: set documentation value zero

Co-authored-by: hiroshi <robinhoodie0823@gmail.com>

* Read pro features in free (#939)

* add themes dropdown to free users

* add pro badge to branch selector

* remove pro condition to read multi file sync

* make probadge functional

* fix git access when multifile was disabled

* fix tests

* fix test, coverage

* add more tests

* add feature flags to checkandsetaccess

* fix tests

* build(deps): bump shell-quote from 1.7.2 to 1.7.3 (#924)

* fix minor issues with next branch (#967)

* fix minor issues with next branch

* add rc to version

* fix set values on node (#975)

* fix set values on node for text layers

* remove log

* merge tests

* fixes coverage action (#973)

* 982 112rc2 composition token autocomplete doesnt autosuggest border tokens for new individual stroke widths (#987)

* skip to start screen when create new file

* resolve test error

* add env

* choose borderWidth when selecting borderWidthTop

Co-authored-by: hiroshi <robinhoodie0823@gmail.com>

* fix: token sets show as list for free users even when using multi file sync (#983)

* fix set list showing up as list for free-users when using MFS

* bump version

* Add cypress test for using the multi inspector incl remap functionality (#986)

* skip to start screen when create new file

* resolve test error

* add env

* add default tokens

* display applied token on inspector

* remap token

* code refresh

* remove console

* Update cypress/integration/inspector.spec.js

Co-authored-by: hiroshi <robinhoodie0823@gmail.com>
Co-authored-by: Jan Six <six.jan@gmail.com>

* add sentry config

update md

* adjust config

* adjust yarn file

* ADO sync tokens are being pulled from main instead of the current branch (#971)

* skip to start screen when create new file

* resolve test error

* add env

* fix: sync with ado from current branch

Co-authored-by: hiroshi <robinhoodie0823@gmail.com>
Co-authored-by: Jan Six <six.jan@gmail.com>

* remove sentryplugin

* adjust script

Co-authored-by: razvanpop <rop_pazvan@yahoo.com>
Co-authored-by: SwordEdge <yamadera46@hotmail.com>
Co-authored-by: hiroshi <robinhoodie0823@gmail.com>
Co-authored-by: Liam Martens <hi@liammartens.com>
Co-authored-by: MightyDevKnight <102773603+MightyDevKnight@users.noreply.github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sandking1123 added a commit to Sandking1123/figma-tokens that referenced this issue Nov 4, 2023
* feat: Save sort order for multifile tokens

* feat: Implemented sorting of token sets for multifile sync

* fix: Fixed Github cache
octokit/octokit.js#890

* chore: Update tests

* chore: Increase test coverage

* chore: Updated coverage

* chore: Update coverage

* chore: yarn.lock

* fix: Check for array when applying sorting order from metadata file

* fix: Fixed sorting order not being respected for multifile sync when restoring last synced state

* fix: Fixed multifile sync sorting

* fix: Fixed tests

* feat: Implemented UI for multifile sorting

* chore: lockfile

* chore: Increase coverage

* fix: Fixed build

* chore: update test coverage

* chore: Update test coverage

* chore: Improved coverage

* chore: Coverage

* chore: Minor coverage increase

* chore: Fix bug with reordering in tree and fix tests

* fix: Fixed issue with collapsed groups
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

No branches or pull requests

4 participants