Delete subscriber does not delete their notifications
I am deleting the test subscribers when re-seeding the db with the following code:
The promises all seem to resolve successfully. But when I recreate the subscribers, the ones that take on an ID of a previously existing subscriber have their notifications show up. The docs suggest that deleting a subscriber will cascade on their notifications so I'm not sure what the problem is. Could it have to do with active/pending notifications?
Note that even though the notification shows up and is returned from the get sub notifications API, when I tried to act on it, I got the following 400 error:
message: "Message with the id: 660bd381d787d568ef3afe3b was not found for this environment. Make sure to address correct message before trying t…"
.Novu
Start Point - Novu
Novu is an open-source notification infrastructure, built for engineering teams to help them build rich product notification experiences.
4 Replies
Hi @ninadk, I'm an AI assistant for Novu. While a team member reviews this question, I'll look through relevant sources and see if I can provide suggestions. Please tag @Ask Inkeep with any follow-up questions.
-----------------------------
While I generate an answer, here are some sources that might be helpful:
* Marks all the subscriber messages as read, unread, seen or unseen. Optionally you can pass feed id (or array) to mark messages of a particular feed.
* Firebase Cloud Messaging (FCM)
* Python
* Recipes
-----------------------------
Answer
Based on the information you've provided and the documentation available, it seems like you're encountering an issue where notifications still appear for a subscriber even after you've deleted the subscriber and then recreated them with the same ID. The expected behavior as you mentioned should be that deleting a subscriber cascades on their notifications, removing them as well.
The error message you're receiving when trying to act on a notification, mentioning that the message was not found for this environment, suggests that there might be an inconsistency or delay in how deletions and the subsequent recreation of subscribers are being processed and reflected in the system.
Unfortunately, specific details on handling active/pending notifications upon subscriber deletion or nuances around the re-creation of subscribers with the same IDs and their impact on notifications are not clearly outlined in the provided documentation excerpts. Additionally, there's no direct mention in the provided documents of how to troubleshoot or resolve the specific error message you're encountering.
Given the lack of explicit information on this scenario in the provided documentation, it's recommended to ensure that:
- You're allowing sufficient time for deletion operations to fully propagate through the system before recreating subscribers with the same IDs.
- Confirm that the notifications you're seeing for the newly recreated subscribers are not new or duplicated notifications that were sent after the subscriber was recreated rather than residual notifications from before their deletion.
If the issue persists and is not related to a delay in operation propagation or a misunderstanding of the system's behavior, it might be beneficial to review the official Novu documentation for any updates or contact Novu support directly for guidance on this specific scenario.
Got it. Tagging @Support for additional help.
Here's my code including how I re-create the subscribers after deleting.
@ninadk
Thanks for sharing the issue
I am looking into this
I see it is not reproducible.
Could you please share the subscriberId and environmentId?
Sure. Environment id:
659fb61f76272e378b87e463
, subscriber id 4
.