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 data proxy unsupported before exit event #8274

Conversation

mmachatschek
Copy link
Contributor

This is based on the branch of PR #7964 as I tested all prisma versions from 4.3.1 (current keystone supported version) to 4.9.0. Earlier versions had problems with parsing the prisma:// database urls

@changeset-bot
Copy link

changeset-bot bot commented Jan 24, 2023

⚠️ No Changeset found

Latest commit: 799fe84

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

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link

vercel bot commented Jan 24, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
keystone-next-docs ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Jan 24, 2023 at 7:05PM (UTC)

@mmachatschek mmachatschek marked this pull request as draft January 24, 2023 19:01
@codesandbox-ci
Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 799fe84:

Sandbox Source
@keystone-6/sandbox Configuration

@vercel vercel bot temporarily deployed to Preview January 24, 2023 19:05 Inactive
@mmachatschek mmachatschek changed the title Fix data proxy missing before exit event Fix data proxy unsupported before exit event Jan 24, 2023
@borisno2 borisno2 self-assigned this Jan 24, 2023
});

// beforeExit event is not supported by Prisma Data Proxy
if (!prismaClient._dataProxy) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm accessing the internal variable prismaClient._dataProxy here because the only alternative to check for dataProxy usage would be:

prismaClient.getEngine().constructor.name === 'DataProxyEngine'

@dcousens dcousens removed the blocked label Feb 28, 2023
@dcousens dcousens marked this pull request as ready for review February 28, 2023 23:15
// to ensure that the process is cleaned up appropriately.
prismaClient._engine.child?.kill('SIGINT');
});
}
Copy link
Member

Choose a reason for hiding this comment

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

Do we actually need this still?

Copy link
Member

Choose a reason for hiding this comment

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

I am unable to replicate the original issue (#5477) if I remove this whole prismaClient.$on block

Copy link
Member

Choose a reason for hiding this comment

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

Let's drop it

@borisno2
Copy link
Member

borisno2 commented Mar 1, 2023

Moved changes over to #8347 - Closing the PR... thanks @mmachatschek

@borisno2 borisno2 closed this Mar 1, 2023
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