Skip to content

Conversation

@unvsrlab
Copy link

@unvsrlab unvsrlab commented Jul 14, 2025

Fixed Issue #28

Fixed other bugs introduced by using a problematic query to fetch strapiObject. The afterUpdate and afterCreate events are triggered by various actions (e.g. updating a draft or publishing a record). The getStrapiObject() function uses a query that is different to the query in those actions. For example, when updating a draft or publishing a record in non-default language, getStrapiObject always fetches the wrong record because it searches for the wrong state (published) in the wrong language (locale=default). Thus, checking event.result?.id === strapiObject.id is necessary.

See this comment for more details.

NoailletasJordan added a commit to NoailletasJordan/strapi-plugin-strapi-algolia that referenced this pull request Nov 15, 2025
- Add locale parameter to getStrapiObject query to fix multi-language issues
- Skip draft update events to prevent duplicate indexing
- Add event.result.id validation to ensure correct record matching
- Add postinstall script to auto-build when installed from GitHub
- Add debug console log to verify plugin loading
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.

1 participant