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

throw new QueryRunnerAlreadyReleasedError() #2868

Open
onursonmez opened this issue May 27, 2024 · 4 comments
Open

throw new QueryRunnerAlreadyReleasedError() #2868

onursonmez opened this issue May 27, 2024 · 4 comments
Assignees
Labels
type: bug 🐛 Something isn't working

Comments

@onursonmez
Copy link

I developed the Wishlist plugin located at https://docs.vendure.io/guides/developer-guide/plugins/. When I successively click on the Login, AddtoWishlist, GetWishlist, RemoveFromWishlist mutations from the http://localhost:3000/shop-api screen, Vendure Server crashes and I get the error in the screenshot below.

To Reproduce
Steps to reproduce the behavior:
Enter the http://localhost:3000/shop-api screen and prepare 4 mutations that log in, insert, get and remove. Run these mutations one after another by pressing the play button. Vendure Server will crash.

Expected behavior
Vendure Server should not crash due to Postgresql in consecutive queries.

Environment (please complete the following information):

  • @vendure/core version: 2.2.4
  • Nodejs version v18.20.0
  • Database (mysql/postgres etc): postgresql
Screenshot 2024-05-27 at 22 27 27 Screenshot 2024-05-27 at 22 27 44
@onursonmez onursonmez added the type: bug 🐛 Something isn't working label May 27, 2024
@onursonmez
Copy link
Author

onursonmez commented May 27, 2024

@Mutation()
@Transaction()

It was fixed when I changed the above code in the wishlist.resolver.ts file as follows, that is, deleted the @transaction() part.

@Mutation()

Do you have any idea why he's doing this? Is @transaction expecting multiple triggers? If so, the @transaction sections in the documentation at https://docs.vendure.io/guides/developer-guide/plugins/ also need to be removed.

@michaelbromley
Copy link
Member

Hi,

The solution should not be to remove the @Transaction() decorator, since we do generally want mutations to run inside transactions. I'm not sure how it is that running the mutations one after the other causes the issue you reported. I'll see if I can reproduce.

@michaelbromley
Copy link
Member

I am not able to reproduce this (see screen recording).

Recording.2024-06-03.135717.mp4

@Rana-Faraz
Copy link

Rana-Faraz commented Nov 27, 2024

If you run the addToWhishlist mutation twice then the server crashes with the given error.

in simple words

  • If the variant is already in the wishlist and you run the mutation again (trying to add a variant to wishlist when that variant is already in the wishlist) the server crashes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug 🐛 Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants