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

fix: headless api client remove/refetch query scenarios #5021

Merged
merged 4 commits into from
Jan 5, 2024

Conversation

vichustephen
Copy link
Contributor

What change does this PR introduce?

Here , I have fixed the issues over remove/refetch scenarios in Headless api methods

Why was this change needed?

In headless API we use a set of events like markAs, listenNotificationReceive, deleteNotification, deleteNotifications,etc. While we use these methods to integrate our custom component with novu we have found some issues. When we make changes to notifications it should refetch the queries at certain events and remove them for certain events.

  1. When a single notification is deleted , the queries must be refetched.
  2. When we receive a new notification , the queries must be refetched.
  3. When all notifications are removed . the queries must be removed.
  4. When unseenCount changed , the queries must not be removed.
  5. When unreadCount changed, the queries must not be removed.

Closes #5011 : https://github.com/novuhq/novu/issues/5011

Other information (Screenshots)

I have tested the scenarios in my local environment.

@jainpawan21 jainpawan21 linked an issue Dec 22, 2023 that may be closed by this pull request
2 tasks
Copy link
Member

@jainpawan21 jainpawan21 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vichustephen please look into failing tests

@vichustephen
Copy link
Contributor Author

@vichustephen please look into failing tests

@jainpawan21 I need a little help here. Since I changed how the methods must be called , the test cases is an expected behaviour. Should I update the test cases also ?

@jainpawan21
Copy link
Member

@vichustephen please look into failing tests

@jainpawan21 I need a little help here. Since I changed how the methods must be called , the test cases is an expected behaviour. Should I update the test cases also ?

Yes please update the tests accordingly

@jainpawan21
Copy link
Member

@BiswaViraj Could you please help @vichustephen

@BiswaViraj
Copy link
Member

@vichustephen , Yes you'll need to update the test cases as well, as the methods have been changed

@vichustephen
Copy link
Contributor Author

@jainpawan21 @BiswaViraj I have updated the test cases

@jainpawan21 jainpawan21 merged commit 4bdb723 into novuhq:next Jan 5, 2024
21 checks passed
@vichustephen vichustephen deleted the headless_api_issue_fix branch January 8, 2024 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🐛 Bug Report: Headless API issue over removing and refetching queries.
3 participants