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(nuxt): do not compute useFetch key from headers (reverting #23462) #24333

Merged
merged 2 commits into from Nov 16, 2023

Conversation

webfansplz
Copy link
Contributor

@webfansplz webfansplz commented Nov 16, 2023

πŸ”— Linked issue

resolves #23900 #24321

Be related to #23462

❓ Type of change

  • πŸ“– Documentation (updates to the documentation, readme or JSdoc annotations)
  • 🐞 Bug fix (a non-breaking change that fixes an issue)
  • πŸ‘Œ Enhancement (improving an existing functionality like performance)
  • ✨ New feature (a non-breaking change that adds functionality)
  • 🧹 Chore (updates to the build process or auxiliary tools and libraries)
  • ⚠️ Breaking change (fix or feature that would cause existing functionality to change)

πŸ“š Description

πŸ“ Checklist

  • I have linked an issue or discussion.
  • I have updated the documentation accordingly.

Copy link

stackblitz bot commented Nov 16, 2023

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copy link
Member

@danielroe danielroe left a comment

Choose a reason for hiding this comment

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

We'll need to update the tests as well - we can change them from headers -> query param tests.

/* @ts-expect-error Overriding auto-key */
await useFetch('/api/test', { headers: { id: '3' } }, '')
/* @ts-expect-error Overriding auto-key */
await useFetch('/api/test', { headers: { id: ref('3') } }, '')
const headers = new Headers()
headers.append('id', '3')
/* @ts-expect-error Overriding auto-key */
await useFetch('/api/test', { headers }, '')
/* @ts-expect-error Overriding auto-key */
await useFetch('/api/test', { headers: [['id', '3']] }, '')
/* @ts-expect-error Overriding auto-key */
await useFetch('/api/test', { headers: [['id', ref('3')]] }, '')
/* @ts-expect-error Overriding auto-key */
await useFetch('/api/test', { headers: [[computed(() => 'id'), '3']] }, '')
expect.soft(getPayloadEntries()).toBe(baseCount + 3)

Copy link
Member

@danielroe danielroe left a comment

Choose a reason for hiding this comment

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

Thank you!

@danielroe danielroe changed the title fix: remove fetch cache key with headers fix(nuxt): do not compute useFetch key from headers (reverting #23462) Nov 16, 2023
@danielroe danielroe merged commit 55e0f38 into nuxt:main Nov 16, 2023
35 checks passed
@github-actions github-actions bot mentioned this pull request Nov 16, 2023
@webfansplz webfansplz deleted the hotfix branch November 16, 2023 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

useRequestHeaders and useFetch are incompatible in 3.8.0
2 participants