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

Multiple notifications make last notification unable to dismiss #44

Closed
andergabilondo opened this issue Dec 23, 2019 · 5 comments
Closed

Comments

@andergabilondo
Copy link

andergabilondo commented Dec 23, 2019

When more than 20 notifications arrive without dismissing any of them, the last one remains, unable to dismiss.

To test it:

`const notificationInterval = setInterval(
() =>
storeNotification.addNotification({
title: 'Wonderful!',
message: 'teodosii@react-notifications-component',
type: 'success',
insert: 'top',
container: 'top-right',
animationIn: ['animated', 'fadeIn'],
animationOut: ['animated', 'fadeOut'],
dismiss: {
duration: 0,
onScreen: false
}
}),
1000
);

setTimeout(() => {
clearInterval(notificationInterval);
}, 22000)`

Thanks for the job, the component is awesome

@andergabilondo andergabilondo changed the title Multiple notifications make las notification unable to dismiss Multiple notifications make last notification unable to dismiss Dec 23, 2019
@andergabilondo
Copy link
Author

Here comes an update. The problem appears when you dismiss them quickly. The onRemoval function does not execute but the notifications are graphically dismissed. The result is a notification that is not possible to remove.

@teodosii
Copy link
Owner

teodosii commented Dec 23, 2019

I tried on GitHub pages and I was not able to reproduce. You're saying onRemoval is not being executed but your example does not have any onRemoval callback. Could you record your screen while doing this? As gif would help. Or provide an example that I'll be able to reproduce it each time, otherwise I cannot help you.

I double checked the handling for dismissal and it's always updating the previous state which should always result in correct dismissal.

@andergabilondo
Copy link
Author

Fail

Hello,
I have tried to reproduce the issue with the github pages. I achieved it partially,

The problem comes in the mobile device emulation. I created a console.log with a counter that prints on every dismiss. If you click fast in the first notification before the transition completes, the onRemoval action is not executed.

let counter = 0; ... onRemoval: () => { console.log(counter); counter++; },

In my code (haven't found the reason yet), the result is shown in the gif. The notifications are fixed and unable to remove.

Thanks for your support!

@teodosii
Copy link
Owner

Thank you for details, will look into it but most likely will get fixed after New Year

@teodosii
Copy link
Owner

I've tried reproducing this bug but it didn't happen to me. Not even once. Could you have a look again at that? I really don't know what would be causing this as I tried manually spamming notifications and each of them gets closed afterwards. Will close it for now and I'm waiting for your answer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants