Skip to content

🐛 Bug Report: Notifications with deleted: false are not returned by queries (self-hosted) #9942

@katyaterletskaya

Description

@katyaterletskaya

📜 Description

Query results exclude documents where the "deleted" field is set to false. This issue seems to have arisen following the commit, which introduced new pre-hook logic that specifies deleted: { $exists: false }.

I have not been able to find any migration scripts designed to remove the "deleted" field, which may help mitigate this concern. I would appreciate guidance on where to find the relevant migration scripts or recommendations for addressing this issue.

👟 Reproduction steps

  1. Query notifications from the Message repository
  2. Observe that documents with deleted: false are not returned

👍 Expected behavior

Queries should return all non-deleted messages, including those where deleted is explicitly set to false.

👎 Actual Behavior with Screenshots

Documents with deleted: false are excluded from query results due to the deleted: { $exists: false } condition.

Novu version

3.12.0

npm version

10.8.2

node version

20.19.0

📃 Provide any additional context for the Bug.

No response

👀 Have you spent some time to check if this bug has been raised before?

  • I checked and didn't find a similar issue

🏢 Have you read the Contributing Guidelines?

Are you willing to submit PR?

None

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions