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

Notifications Appearing as duplicates #56

Closed
john-mbone opened this issue Mar 3, 2020 · 7 comments
Closed

Notifications Appearing as duplicates #56

john-mbone opened this issue Mar 3, 2020 · 7 comments

Comments

@john-mbone
Copy link

john-mbone commented Mar 3, 2020

const notification = {
  title,
  message: info,
  type: "default",
  insert: "top",
  container: "top-right",
  animationIn: ["animated", "fadeIn"],
  animationOut: ["animated", "fadeOut"],
  timingFunction: "ease-out",
  dismiss: {
    duration: 3000,
    onScreen: true
  }
};
store.addNotification(notification);
@teodosii
Copy link
Owner

teodosii commented Mar 3, 2020

???

@john-mbone
Copy link
Author

I have integrated firebase push in my web app,when a push notification is sent,the notifications appears on nth times the push was send i.e if i send twice then send again,the user will see four notifications with the same message.

@john-mbone
Copy link
Author

Earlier this morning i encountered this error too how can i fix?
Warning: Encountered two children with the same key, 26gs46g8k. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted — the behavior is unsupported and could change in a future version.
in div (created by ReactNotificationComponent)
in div (created by ReactNotificationComponent)
in ReactNotificationComponent (at NavMenu.js:224)
in NavMenu (at App.js:122)
in App (at src/index.js:36)
in Router (created by BrowserRouter)
in BrowserRouter (at src/index.js:35)
in Provider (at src/index.js:34)

@teodosii
Copy link
Owner

teodosii commented Mar 5, 2020

The duplicate thing is really weird, I don't see any explanation for that why is it happening. The second case where the key is duplicated was reported in the past but I was never able to reproduce it. Id is a Math.random randomisation, I doubt it's generating twice the same result for same timestamp. Will further investigate but atm I have no clues.

@john-mbone
Copy link
Author

john-mbone commented Mar 5, 2020 via email

teodosii added a commit that referenced this issue Mar 14, 2020
@teodosii
Copy link
Owner

I changed the way we were generating the id, I suspect the bug was due to the random function. Fix was done in 2.4.0 and id will point to an increment rather than a random.

Please check and let me know if it's working for you now.

@john-mbone
Copy link
Author

john-mbone commented Mar 14, 2020 via email

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