-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
🐛 Bug Report: Missing server api endpoints compared to client #5051
Comments
@lwuethrich-devedis I am confused here. Referring to point 1. How can we delete messages with a feed ID? Feed ID will delete only feeds right? Also can you please mention which client SDK you are specifically referring to? I have seen that many SDKs are not consistent in respect to the APIs they are implementing. |
@VishalMCF I am mentioning the headless-service javascript sdk. For example, to delete all messages (1.) following method signature exists on the
The feed id here is optional and if not passed all notifications of a user are deleted. In the server api reference there exists:
There is also a section about notifications without a delete. As it seems it is not possible to delete all messages or messages in bulk is this correct? Also fetching all messages (2.) given the filter does not seem possible in the server api as well if I am not mistaken.
The server api https://docs.novu.co/api-reference/messages/get-messages does not have the same query options. |
I believe this issue has to be opened again. Currently it is not possible to implement a custom notification panel with some functionality as 'delete all notifications' and fetching all messages given a specific filter. |
@VishalMCF See my previous answer |
📜 Description
I think the server api is missing certain functionality compared to the client's one.
Delete all messages
This is possible in the client sdk implementation when the feed id is set to null but the server api specifies that the feedId
is required
Fetch all messages given a filter
In the client sdk we can fetch unread/read messages, the server api does not provide a filter. It is possible to fetch notifications and restrict them to a channel but nothing more.
It does not seem possible to fetch a single message given their id. This is of relevance due to point 4.
Something that I noticed is that a client can delete a notification given the messageId only. I assume the endpoint checks the given subscriber id, so a subscriber can only delete their own messages. On the server api there is only a delete given the message's id. In order to check if the message actually belongs to the user then I would need to fetch the message first which I think is not possible due to (3.). The server should probably accept the subscriber id as well and only delete the message if it actually belongs to the subscriber.
I went through the api reference (https://docs.novu.co/api-reference/overview) but I might have gotten something wrong. I am happy for all clarifications.
👟 Reproduction steps
👍 Expected behavior
The server api should at least have the same capabilities as the client sdk api in allr egards
👎 Actual Behavior with Screenshots
They do not match see my description in the bug report
Novu version
Novu SaaS
npm version
No response
node version
No response
📃 Provide any additional context for the Bug.
No response
👀 Have you spent some time to check if this bug has been raised before?
🏢 Have you read the Contributing Guidelines?
Are you willing to submit PR?
None
The text was updated successfully, but these errors were encountered: