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

[plugin-search] afterDelete hook fails to delete stale search entries #5709

Closed
wkentdag opened this issue Apr 6, 2024 · 3 comments
Closed
Assignees

Comments

@wkentdag
Copy link
Contributor

wkentdag commented Apr 6, 2024

Link to reproduction

https://github.com/wkentdag/payload-search-delete-bug

Describe the Bug

When you delete an item from a search-enabled collection, the stale search results are not deleted. This request in the afterDelete hook returns 0 results when there should be 1.

I was able to fix to fix the issue by copying the existing afterDelete hook into my collections and removing the req option from the aforementioned query [ref]. It looks like that line was introduced recently in #5068 to support transactions.

search-delete-bug-compressed.mov

To Reproduce

  1. Clone my example repo and run it
  2. create a new Page, note its search result entry, then delete it, note the stale search result entry
  3. do the same thing for Pages with custom hooks, note that it works

Payload Version

2.12.1

Adapters and Plugins

bundler-webpack, db-postgres, plugin-search

@wkentdag wkentdag added the status: needs-triage Possible bug which hasn't been reproduced yet label Apr 6, 2024
@paulpopus paulpopus self-assigned this Apr 8, 2024
@paulpopus paulpopus added status: verified If an issue has been reproduced and removed status: needs-triage Possible bug which hasn't been reproduced yet labels Apr 8, 2024
@paulpopus
Copy link
Contributor

Looks like this is fixed in v3

@github-actions github-actions bot removed the status: verified If an issue has been reproduced label Jul 23, 2024
@paulpopus
Copy link
Contributor

Never mind it's isolated to postgres, I will keep this closed as it's a postgres problem specifically and we'll track progress in the other issue

Copy link

github-actions bot commented Sep 7, 2024

This issue has been automatically locked.
Please open a new issue if this issue persists with any additional detail.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants