You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(examples/vue): throw on non-ok 'fetch' responses in the query functions - #12133
fetch resolves on HTTP error statuses, so the Vue examples' query functions treated responses like 404 as successful data and never reached their error states.
Check response.ok and throw before parsing the body in every query function across basic, dependent-queries, persister, simple, nuxt3, 2.6-basic, and 2.7-basic.
Convert the .then() chains to async/await so the check fits in.
In persister, the artificial 1s delay stays in place after the check.
I have tested code changes locally with pnpm run test:pr, or these tests do not apply to this pull request.
I have followed the AI contribution policy and fully understand the code in this pull request, including any code generated with AI assistance.
🚀 Release Impact
This change affects published code, and I have generated a changeset.
This change is docs/CI/dev-only (no release).
Summary by CodeRabbit
Bug Fixes
Vue examples now detect unsuccessful HTTP responses when loading posts, authors, and repository data, and report an error instead of attempting to use the response body. Successful responses continue to load as before.
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
Reviewing files that changed from the base of the PR and between 8c3f218 and 1def074.
📒 Files selected for processing: 12
examples/vue/2.6-basic/src/Post.vue
examples/vue/2.6-basic/src/Posts.vue
examples/vue/2.7-basic/src/Post.vue
examples/vue/2.7-basic/src/Posts.vue
examples/vue/basic/src/Post.vue
examples/vue/basic/src/Posts.vue
examples/vue/dependent-queries/src/Post.vue
examples/vue/dependent-queries/src/Posts.vue
examples/vue/nuxt3/app.vue
examples/vue/persister/src/Post.vue
examples/vue/persister/src/Posts.vue
examples/vue/simple/src/App.vue
Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.
📝 Walkthrough
Vue example fetchers now check the HTTP response status. They throw resource-specific errors for non-OK responses and parse successful responses as JSON.
Changes: Vue fetcher status handling
Layer / File(s)
Summary
Check response status before parsing examples/vue/{2.6-basic,2.7-basic,basic,dependent-queries,persister}/src/{Post,Posts}.vue, examples/vue/nuxt3/app.vue, examples/vue/simple/src/App.vue
Fetchers throw errors when responses are not OK. Successful responses are parsed as JSON. The persister posts fetcher retains its one-second delay before parsing.
The Vue examples now report unsuccessful HTTP responses as query errors. No actionable merge-blocking risk is identified.
Pre-merge checks: 5
Check name
Status
Explanation
Title check
The title clearly and concisely describes the main change: Vue example query functions now throw for non-OK fetch responses.
Description check
The description includes all required template sections, explains the motivation and implementation, completes the checklist, and identifies the change as docs/dev-only with no release impact.
Docstring Coverage
No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check
Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check
Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage
Explanation
No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (12 skipped: 12 unsupported.)
✨ Finishing Touches
🧪 Generate unit tests (beta)
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎯 Changes
fetchresolves on HTTP error statuses, so the Vue examples' query functions treated responses like 404 as successful data and never reached their error states.response.okand throw before parsing the body in every query function acrossbasic,dependent-queries,persister,simple,nuxt3,2.6-basic, and2.7-basic..then()chains toasync/awaitso the check fits in.persister, the artificial 1s delay stays in place after the check.✅ Checklist
pnpm run test:pr, or these tests do not apply to this pull request.🚀 Release Impact
Summary by CodeRabbit