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(client): throw error on caching platforms #18437

Merged
merged 17 commits into from
Apr 4, 2023

Conversation

millsp
Copy link
Member

@millsp millsp commented Mar 23, 2023

Detects when Prisma Client is in an environment that is known to cause caching issues and throws an error for the user to fix.

Reminder of the problem:
On the first publication to eg. Vercel, the client will auto-generate and it will get cached. Then we change the schema, and on the second publication, the client will not auto-generate. Because @prisma/client is cached already, the auto-generate won't trigger again. We then have a caching problem, and queries or validation fail because of the de-sync.

Relevant research:
https://github.com/millsp/vercel-prisma-cache-issue-repro
https://www.notion.so/prismaio/Research-Vercel-Netlify-caching-behavior-4ca3e950d7bb43e081a1a2f5a5149518
https://prisma-company.slack.com/archives/C04D5C9D1FG/p1679440563960249

Issues:
Fixes https://github.com/prisma/prisma-private/issues/157
Fixes #6634
Fixes #7291
Fixes #7818
Closes https://github.com/prisma/client-planning/issues/296

Related PRs:
prisma/ecosystem-tests#3454

@codspeed-hq
Copy link

codspeed-hq bot commented Mar 23, 2023

CodSpeed Performance Report

Merging #18437 integration/fix/throw-error-platform-caching (d4cdc0b) will not alter performances.

Summary

🔥 0 improvements
❌ 0 regressions
✅ 3 untouched benchmarks

🆕 0 new benchmarks
⁉️ 0 dropped benchmarks

@socket-security
Copy link

socket-security bot commented Mar 24, 2023

New dependency changes detected. Learn more about Socket for GitHub ↗︎


👍 No new dependency issues detected in pull request

Bot Commands

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of package-name@version specifiers. e.g. @SocketSecurity ignore foo@1.0.0 bar@* or ignore all packages with @SocketSecurity ignore-all

Pull request alert summary
Issue Status
Install scripts ✅ 0 issues
Native code ✅ 0 issues
Bin script shell injection ✅ 0 issues
Unresolved require ✅ 0 issues
Invalid package.json ✅ 0 issues
HTTP dependency ✅ 0 issues
Git dependency ✅ 0 issues
Potential typo squat ✅ 0 issues
Known Malware ✅ 0 issues
Telemetry ✅ 0 issues
Protestware/Troll package ✅ 0 issues

📊 Modified Dependency Overview:

➕ Added Package Capability Access +/- Transitive Count Publisher
ci-info@3.8.0 environment +0 sibiraj-s

@millsp millsp marked this pull request as ready for review March 28, 2023 23:28
@millsp millsp requested a review from a team March 28, 2023 23:28
@millsp millsp requested review from SevInf and removed request for a team March 28, 2023 23:28
@millsp millsp added this to the 4.13.0 milestone Mar 28, 2023
@millsp millsp merged commit 5acfc52 into main Apr 4, 2023
53 checks passed
@millsp millsp deleted the integration/fix/throw-error-platform-caching branch April 4, 2023 22:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants