Fix duplicate startup introspection requests#1539
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
Summary by CodeRabbit
Walkthrough
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
✨ Simplify code
Comment |
|
Compute preview deployed. Branch: |
There was a problem hiding this comment.
Warning
CodeRabbit couldn't request changes on this pull request because it doesn't have sufficient GitHub permissions.
Please grant CodeRabbit Pull requests: Read and write permission and re-run the review.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.changeset/bright-dragons-introspect-once.md:
- Line 5: Add a top-level Markdown heading to the changeset body after its
frontmatter so it satisfies markdownlint rule MD041, while preserving the
existing release-note text.
In `@ui/studio/context.test.tsx`:
- Around line 210-215: Update the rerender sequence in the adapter reset test
around resetQueriesSpy to rerender with the unchanged nextAdapter configuration
and assert the spy call count remains 1 before toggling hasDatabase. Keep the
existing assertion that changing hasDatabase increases the count to 2.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 6256d8c3-601d-4ac2-99a9-af0f8e44d1ba
📒 Files selected for processing (5)
.changeset/bright-dragons-introspect-once.mdArchitecture/introspection.mdFEATURES.mdui/studio/context.test.tsxui/studio/context.tsx
#29720) ## Summary - update the bundled `@prisma/studio-core` from 0.27.3 to 0.33.0 - stop logging response-stream failures after the browser has already disconnected - handle the new optional `query-insights` BFF procedure with an explicit unsupported response - add regressions for disconnected clients and the expanded Studio BFF contract Studio Core 0.33.0 includes the Prisma Next Migrations viewer and the duplicate startup-introspection fix from prisma/studio#1539. ## Validation - `pnpm --dir packages/cli exec vitest run src/__tests__/Studio.vitest.ts src/__tests__/studio-server.vitest.ts` (19 passed) - `pnpm --filter prisma build` - `pnpm --filter prisma tsc` - ESLint and Prettier checks for all touched files - frozen offline lockfile install - PostgreSQL 17 end-to-end run with two migrations applied by Prisma Next: Studio listed both migrations, rendered schema deltas, and displayed their SQL operations - real delayed BFF request aborted by the client: no server error was logged, and an immediate follow-up query succeeded The broader CLI suite completed with 240 passing tests and three `incomplete-schemas` Wasm snapshot failures caused by the local schema engine returning `Schema engine error` instead of the expected P1013 detail. The same three failures reproduce on an unchanged `origin/main` checkout.
Summary
StudioContextProviderfirst mounts@prisma/studio-core0.33.0Root cause
The database-configuration effect ran on the initial mount and called
queryClient.resetQueries(). Child introspection queries had already started, so TanStack Query cancelled both BFF requests and immediately issued them again. Prisma ORM's Node server surfaced the cancelled response pipelines asERR_STREAM_PREMATURE_CLOSE.Validation
pnpm typecheckpnpm lint(passes with existing repository warnings)pnpm test:ui— 624 passedpnpm test— 908 passed, 38 skippedpnpm buildpnpm check:exportspnpm changeset status— minor bump to 0.33.0pnpm demo:ppg+ Playwright athttp://localhost:4310