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: resolve issue when updating or adding content type in draft mode #998

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ratorik
Copy link

@ratorik ratorik commented Jan 17, 2025

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 #997. The item should update correctly without errors when draftAndPublish is enabled.

Pull Request

Related issue

Fixes #997

What does this PR do?

  • Resolves the issue where items with draftAndPublish enabled are removed from Meilisearch and cause transaction errors.
  • Ensures that updates to items are processed correctly 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.
@Strift
Copy link
Contributor

Strift commented Jan 29, 2025

Hello @ratorik, thanks so much for your contribution. 🙌

Would it be possible to add a test for this addition, so we can avoid any regression in the future?
This would also serve as a way to document the expected behavior.

@Strift Strift added the bug Something isn't working label Jan 29, 2025
@ratorik
Copy link
Author

ratorik commented Feb 10, 2025

Hey @Strift,

Thanks for your feedback! I'll look into adding a test for this to help prevent regressions. That said, as mentioned in the ticket by @daandegooijer, the best long-term solution might be to revamp the lifecycles and align with the Strapi documentation. Since this was just a quick fix, maybe it makes sense to address the broader issue instead? Let me know what you think!

@Strift
Copy link
Contributor

Strift commented Feb 11, 2025

Hi @ratorik,

I think it's better to submit this small fix first, and then work on the broader fix in a second step. Refactoring a bigger part of the codebase will make the review process more heavy. As a result, changes would get deployed more slowly.

So I'd recommend adding the tests for this PR and then working on the revamp.

If you have the bandwidth to work on it, a broader fix would be welcome. Just consider that it could take me and other contributors a longer time to review it.

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

Successfully merging this pull request may close these issues.

Meilisearch update failure with draftAndPublish enabled: Transaction query already complete
2 participants