[DevTools] Fix crash on reorder operation mismatch#35376
[DevTools] Fix crash on reorder operation mismatch#35376shash-hq wants to merge 1 commit intofacebook:mainfrom
Conversation
eps1lon
left a comment
There was a problem hiding this comment.
Appreciate the attempt to fix these. Usually these are legit bugs in the DevTools reconciler so we can't just safely skip over it every time.
Do you have a reproduction for the bug you're seeing?
|
Ya that makes sense. I went with the defensive approach to keep the DevTools UI from crashing entirely, but I agree it hides the underlying desync. I don't have a standalone app reproduction yet. I reproduced the crash by writing the regression test which is included in this PR (which manually feeds a mismatched child count to the store). The original issue points to duplicate keys causing the backend to send these invalid operations. Would you prefer I look into filtering those out on the backend before they are sent, or is a full reproduction app required first? |
Debugged a crash where Store throws "Children cannot be added or removed..." during a reorder op.
It seems to happen when the frontend and backend get out of sync regarding the children list (e.g. duplicate keys).
This PR adds a guard in onBridgeOperations. If the operation implies a child count that mismatches the store's state, it now warns and safely skips the operation instructions instead of blowing up the whole DevTools UI.
Added a regression test case to verify the bailout logic.
Fixes #35360