-
Notifications
You must be signed in to change notification settings - Fork 59
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
Meilisearch update failure with draftAndPublish enabled: Transaction query already complete #997
Comments
Yeah i had the same issue, its because the afterCreate lifecycle hook isn't correct. I made a patch and after that it works. |
@daandegooijer can you share te patch you have made? |
strapi-plugin-meilisearch-npm-0.13.1-ccc59888c7.patch Yes of course :) |
@daandegooijer bedankt ! |
np! Don't know if creating a PR does anything, seems like its not really maintaned. |
Hello @daandegooijer, thanks for your help here! A PR to fix this issue would actually be welcome. We will review and merge any PR fixing the issue that adheres to our contributing guidelines. |
…abled fix: resolve Meilisearch issue with draftAndPublish enabled When updating or adding an item with draftAndPublish enabled, the item is removed from Meilisearch, and the following error occurs: error: Meilisearch could not add entry with id: 9: Transaction query already complete This issue is described in meilisearch#997. The item should update correctly without errors when draftAndPublish is enabled.
…abled fix: resolve Meilisearch issue with draftAndPublish enabled When updating or adding an item with draftAndPublish enabled, the item is removed from Meilisearch, and the following error occurs: error: Meilisearch could not add entry with id: 9: Transaction query already complete This issue is described in meilisearch#997. The item should update correctly without errors when draftAndPublish is enabled.
Ratorik was quicker ;-) But its just a quick fix but the best way to fix this is to revamp the lifecycles and implement the strapi document way. |
Description:
When updating / adding an item in the Meilisearch plugin with the draftAndPublish option enabled for a content type, the item is removed from Meilisearch, and I receive the following error:
error: Meilisearch could not add entry with id: 9: Transaction query already complete, run with DEBUG=knex:tx for more info
This issue only occurs when the draftAndPublish feature is enabled. When I disable this option, the update works as expected, and the item is correctly uploaded to Meilisearch.
Expected behavior:
The item should be updated in Meilisearch without issues.
Current behavior
The item is removed from Meilisearch, and the error is displayed. However, if the "Update" button in the plugin is pressed, the items are correctly synchronized. This likely happens because all items are deleted first and then added again during the synchronization process, bypassing the issue.
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: