refine icon indicating copy to clipboard operation
refine copied to clipboard

[BUG] Material UI notification popups twice

Open hanifmianjee10p opened this issue 2 years ago • 3 comments

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

  1. Goto /posts/edit/100000
  2. Where ID 100000 doesn't exist in the database
  3. Wait for a couple of seconds for multiple retries
  4. 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 avatar Jan 13 '23 09:01 hanifmianjee10p

@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 🙏

alicanerdurmaz avatar Jan 16 '23 09:01 alicanerdurmaz

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.

stale[bot] avatar May 13 '23 07:05 stale[bot]

@omeraplak Can I work on this one?

ALIRAZA17 avatar May 15 '23 20:05 ALIRAZA17

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.

stale[bot] avatar Jul 15 '23 00:07 stale[bot]