react-admin icon indicating copy to clipboard operation
react-admin copied to clipboard

ID's with very similar UUIDs get "Warning: flattenChildren" on LIST

Open Balipeace opened this issue 9 years ago • 4 comments

An LIST with ids that are very similar to each other get "Warning: flattenChildren" and only a few records get listed and the rest get rejected/ignored.

Error: proxyConsole.js:56 Warning: flattenChildren(...): Encountered two children with the same key, .$null. Child keys must be unique; when two children share a key, only the first child will be used.

Example UUIDs: 'bb6dc0f5-9c0e-11e7-a414-c03fd56e659f' 'bb6dc2db-9c0e-11e7-a414-c03fd56e659f' 'bb6dc46c-9c0e-11e7-a414-c03fd56e659f' 'bb6dc5e5-9c0e-11e7-a414-c03fd56e659f' 'bb6dc75a-9c0e-11e7-a414-c03fd56e659f' 'bb6dc8ba-9c0e-11e7-a414-c03fd56e659f' 'bb6dca19-9c0e-11e7-a414-c03fd56e659f'

AOR 1.2.2 Loopback with MySQL

Balipeace avatar Sep 19 '17 10:09 Balipeace

Can you confirm you have the same issue with aor 1.3?

fzaninotto avatar Sep 20 '17 09:09 fzaninotto

Yes. Just updated AOR. No change.

Balipeace avatar Sep 20 '17 11:09 Balipeace

Can't reproduce the issue on master. The error is likely in your code, not admin-on-rest code.

image

If you need help troubleshooting your code, please ask in StackOverflow.

fzaninotto avatar Sep 20 '17 12:09 fzaninotto

In case anyone runs into this problem. I had tagged id for this MySQL table in Loopback as a number (default), forgot to change it into a string for UUID. Loopback was being helpful by responding to a query with an array that included all information, except the id. React then took the first listed array field as key id. The values for this field where identical, resulting in the flattenChildren error.

Balipeace avatar Sep 20 '17 22:09 Balipeace