Open mjclawar opened 5 years ago
More information upon digging further:
This setup caused it:
Output
updates in a single callback function""
) and an empty list for children ([]
)Not sure why it broke inconsistently still.
There should probably be some checking somewhere that ensures all IDs are not empty (we added another line to check that in our internal code), and I still think the behavior above is not necessarily desirable.
I agree that there at least should be some sort of checking for null before doing the .split
– if you'd create a PR for this I'd be happy to review it! Thanks for creating this issue either way.
A 2-character bugfix - and I guess since nobody pinned down its cause we can add it without new tests so it's extra easy. But I'll wait to implement it until we get the repo merge completed.
Description
If a
controllerId
is passed in asnull
to therequestQueue
inTreeContainer.getLoadingState
, the entire Dash application crashes with this exception:Example data for a request in
requestQueue
that causes theTypeError
:This line is causing the issue: https://github.com/plotly/dash-renderer/blob/8fa6d2947d271baa8b1af424e56d9de566796ba9/src/TreeContainer.js#L89
Potential solution
Change
r.controllerId.split('.');
tocontrollerId.split('.');
, which seems like the right way to handle thenull
value, given that it has already been redefined a few lines above. https://github.com/plotly/dash-renderer/blob/8fa6d2947d271baa8b1af424e56d9de566796ba9/src/TreeContainer.js#L86Comments
I'm not actually sure how the
controllerId
is making it through asnull
. I can't provide a small example, because it's happening randomly in one of our larger applications, but we've definitely located it to this line, and making the change fromto
fixes the issue.
We might have some Dash components in our application that are returned with no identifiers here, but it seems like, if this is an intended exception, it should be handled by validation somewhere before making it to this stage of the
dash-renderer
logic. I'm not familiar enough with the request queue to immediately identify where that would occur. The seeming "randomness" of the crashing is concerning (sometimes it works, sometimes it crashes the application).Happy to submit a PR with this change if it is actually a bug!