N
Novuβ€’9mo ago
Stephen

Headless api issue in angular

Hi, I have implemented novu headless in our angular app. So we use methods like fetchNotifcation() , markNotifications() , listenNotificationRecevie() and delete notification(). So during these events such as markAs() the events like fetchNotifcation() is automatically triggered. but when I trigger deleteNotification() or listenNotificationRecevie() the registered event for fetchNotifcation() is getting removed instead being called again . This breaks the usage and causing issues. Why are they getting removed instead of refetching ?
21 Replies
Pawan Jain
Pawan Jainβ€’9mo ago
@Stephen could you please share the code snippet to reproduce the issue?
Stephen
Stephenβ€’9mo ago
Actually we have implemented the above mentioned methods just like it was mentioned in the docs. We noticed this behavior is actually how it is implemented in the headless api. I just don't understand why. I saw the code and the queries are refetched when we call the markAs() method but the queries are removed when a new notification arrives or when a single notification is deleted.
Novu_Bot
Novu_Botβ€’9mo ago
@Stephen, you just advanced to level 2!
Stephen
Stephenβ€’9mo ago
One more issue I would like to introduce is when there are two clients connected with same subscriberId. When client1 deletes a notification the client2 who is also logged in with same subscriberId must be notified of the deletion. Is there any specific event defined to listen for this change ? I have gone through the docs and don't see one
Pawan Jain
Pawan Jainβ€’9mo ago
@Stephen If the subscriberId is same then deletion is performed by same user. In my opinion, user should not be notified for its own actions
Stephen
Stephenβ€’9mo ago
Well yeah that's correct. But consider I have two chrome tabs open and logged in with same subscriberId or if I have my mobile with in-app notifications when delete in one client , it should also be removed from my mobile/ other chrome tab right ? @Pawan Jain this is the issue i mentioned at first . Let me share screenshots
Stephen
Stephenβ€’9mo ago
Look at this image this is method used for notification center component. Here after removing a message the queries are being refetched.
No description
Stephen
Stephenβ€’9mo ago
@Pawan Jain look at this method here. It's in headless api. After removing a notification the queries are removed why ??.
No description
Stephen
Stephenβ€’9mo ago
@Pawan Jain
Pawan Jain
Pawan Jainβ€’9mo ago
Hi @Stephen Thanks for sharing the screenshots. it helped us in understanding the issue better πŸ™‚ @Engineering could someone help us why we are removing and refetching the queries?
Stephen
Stephenβ€’9mo ago
Any updates? @Pawan Jain
BiswaViraj
BiswaVirajβ€’9mo ago
Ok, it should be refetchQueries not removeQueries. Can you please create an issue over GitHub for the same?
Pawan Jain
Pawan Jainβ€’9mo ago
@Stephen Feel free to create a github issue and share in this post Team will priorities for sure
Stephen
Stephenβ€’9mo ago
Alright I have identified few more issues like this. I will create and post
Stephen
Stephenβ€’9mo ago
GitHub
πŸ› Bug Report: Headless API issue over removing and refetching quer...
πŸ“œ Description In headless API we use a set of events like markAs, listenNotificationReceive, deleteNotification, deleteNotifications,etc. While we use these methods to integrate our custom componen...
Want results from more Discord servers?
Add your server