refine
refine copied to clipboard
[BUG] Material UI notification popups twice
Describe the bug
The pop-up is appearing twice when I go to an edit resource page and the resource ID does not exist in the database. It retries multiple times and eventually fails with duplicate toast messages.
/posts/edit/100
Where ID 100 doesn't exist in the database.
I am using RefineSnackbarProvider from @pankod/refine-mui
@alicanerdurmaz Here is the issue that we discussed in the Discord server
Steps To Reproduce
- Goto /posts/edit/100000
- Where ID 100000 doesn't exist in the database
- Wait for a couple of seconds for multiple retries
- Notice the duplicate toast popups
Expected behavior
Notification should trigger only once
Screenshot
No response
Desktop
No response
Mobile
No response
Additional Context
No response
@hanifmianjee10p Hi again,
This issue happens because useQuery
's onError
function is called when we don't want it.
We talked to the core team. We considered a few workarounds but ultimately decided to consult the TanStack community as well. issue on TanStack Query
We will publish the fix with the best practice in the fastest time. I will keep inform you about updates. Thanks again 🙏
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
@omeraplak Can I work on this one?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.