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

Framework: error and success notices don't like to co-exist #2946

Closed
klimeryk opened this issue Feb 1, 2016 · 1 comment · Fixed by #3064
Closed

Framework: error and success notices don't like to co-exist #2946

klimeryk opened this issue Feb 1, 2016 · 1 comment · Fixed by #3064
Assignees
Labels
Framework [Type] Bug When a feature is broken and / or not performing as intended

Comments

@klimeryk
Copy link
Contributor

klimeryk commented Feb 1, 2016

While testing #1916 I've encountered this error in the console:

Warning: flattenChildren(...): Encountered two children with the same key, `.1:$notice-0`. Child keys must be unique; when two children share a key, only the first child will be used.

Steps to reproduce:

  • visit /domains/manage/:site/dns/:domain
  • add a new record, a success notice will be displayed (don't dismiss it)
  • trigger an error (I went offline using the Developer Tools and tried adding a new record)

It seems the success and error notices conflict with each other.
The code triggering this behaviour is in dns-add-new.jsx. Nothing special - just calling notices.success and notices.error with a string. Note that I've observed the same behaviour with a mix of "reduxified" and normal notices (as seen in #1916).

@klimeryk klimeryk added [Type] Bug When a feature is broken and / or not performing as intended Framework labels Feb 1, 2016
@artpi
Copy link
Contributor

artpi commented Feb 1, 2016

Hmm, the code trigerring this is using old notices (not redux)
But good to keep an eye on that while refactoring global notices
#2413

klimeryk pushed a commit that referenced this issue Feb 4, 2016
Otherwise, if we show old and new (from redux store) notices, we'll get
conflicting keys (like notice-0), which are used by React during reder
passes. This will trigger an error in the console and, more importantly,
prevent one of the conflicting notices from showing.
This change changes the old notices' key prefix to a different one than
for the new, reduxified ones, thus preventing the conflict.

Fixes #2946
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Framework [Type] Bug When a feature is broken and / or not performing as intended
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants