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(elements-dev-portal): query invalidation on jwt refresh #2550

Merged
merged 4 commits into from
Mar 20, 2024

Conversation

kaylachun
Copy link
Contributor

@kaylachun kaylachun commented Mar 18, 2024

Elements Default PR Template

In general, make sure you have: (check the boxes to acknowledge you've followed this template)

Other Available PR Templates:

@kaylachun kaylachun changed the title Fix(elements-dev-portal): hook cache invalidation on jwt refresh Fix(elements-dev-portal): query invalidation on jwt refresh Mar 18, 2024
Copy link

netlify bot commented Mar 18, 2024

Deploy Preview for stoplight-elements-demo ready!

Name Link
🔨 Latest commit 9f8939c
🔍 Latest deploy log https://app.netlify.com/sites/stoplight-elements-demo/deploys/65fafe6115af8800088130a7
😎 Deploy Preview https://deploy-preview-2550--stoplight-elements-demo.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Mar 18, 2024

Deploy Preview for stoplight-elements ready!

Name Link
🔨 Latest commit 9f8939c
🔍 Latest deploy log https://app.netlify.com/sites/stoplight-elements/deploys/65fafe61cc0cde0007802190
😎 Deploy Preview https://deploy-preview-2550--stoplight-elements.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@kaylachun kaylachun marked this pull request as ready for review March 18, 2024 20:48
@kaylachun kaylachun requested a review from a team as a code owner March 18, 2024 20:48
@@ -8,7 +8,7 @@ import { getBranches } from '../handlers/getBranches';
export function useGetBranches({ projectId }: { projectId: string }) {
const { platformUrl, platformAuthToken } = React.useContext(PlatformContext);
return useQuery(
[...devPortalCacheKeys.branchesList(projectId), platformUrl, platformAuthToken],
Copy link
Contributor

Choose a reason for hiding this comment

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

is there a user id or some other context we can use?

Copy link
Contributor

Choose a reason for hiding this comment

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

or like if the user is actually logged out or not?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@daniel-white We do have state.auth.isLoggedIn that we can pass through to the provider. Would that work?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok added the isLoggedIn context here 9db422a

Copy link
Contributor

Choose a reason for hiding this comment

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

Is that going to be an issue for anonymous users who never log in?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@brendarearden I just tested it and it works as an anonymous user. My understanding is the array being passed in to useQuery is used as a key and invalidated if any of those values change

Copy link
Contributor

@brendarearden brendarearden left a comment

Choose a reason for hiding this comment

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

lgtm!

@kaylachun kaylachun changed the title Fix(elements-dev-portal): query invalidation on jwt refresh fix(elements-dev-portal): query invalidation on jwt refresh Mar 20, 2024
@kaylachun kaylachun merged commit bcef45f into main Mar 20, 2024
7 checks passed
@kaylachun kaylachun deleted the fix/elements-dev-portal-hooks branch March 20, 2024 15:59
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.

3 participants