-
Notifications
You must be signed in to change notification settings - Fork 32
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
Gatsby-4: Changing environment throws an error when sourcing #117
Comments
@psykzz Thanks for reporting this issue. I will check and get back to you asap. |
@psykzz Can you share the steps to reproduce this issue? |
|
Thanks @psykzz for sharing the steps. Will check this ASAP. |
Any updates on this issue? @vkalta |
@abhishek305 Can you please check this and update @psykzz ? |
More details and a potential fix can be found in #116 (comment) |
Hey @psykzz, |
Yes will check |
Hey @psykzz, Could please elaborate there seems to be some confusion in step 3 are you talking about setting up 2 stacks or a stack with two environments and also the gatsby site sourcing from 2 stacks? |
So I have a stack with multiple environments. In this case i needed to provide the following configuration {
api_key: "stack-api-key"
delivery_token: "environment-a-delivery-token"
environment_name: "environment-a"
} If i then swap to environment B. I replace my config with {
api_key: "stack-api-key"
delivery_token: "environment-b-delivery-token"
environment_name: "environment-b"
} After running the 2nd time, i get {
error_message: 'Failed to fetch items. Please try again with valid parameters.',
error_code: 141,
errors: { access_token: [ 'environment or access token is not matched.' ] }
} This is because i believe the cached data is only keyed by the api_key and so changing the delivery token attempts to use the old cache, which in this case is wrong, leading to the error message. |
Hi @psykzz,
Could you please update the source plugin version and try it once also if possible could you share a few details?
let me know what is observed after the update |
Quick update: |
Once setup, if you change environment (but keeping the same key) you will get the following error.
Looks like we just need to include the environment + api_key in the cache key.
The text was updated successfully, but these errors were encountered: