I verified a runtime mismatch in the frontend layout message flow.
In js/api/ApiProvider.js, layout messages are forwarded as:
apiHandlers.current.onLayoutMessage({
cmd: cmd.data,
update: cmd.commmand == 'layout_update',
});
But in js/main.js, the handler expects:
const onLayoutMessage = ({ data, update }) => {
if (update) parseLayoutsFromServer(data);
else relayout();
};
So ApiProvider sends a cmd field, while onLayoutMessage expects data.
Verified runtime behavior
With temporary console logging added, I observed:
layout message from socket {command: 'layout_update', data: ''}
onLayoutMessage payload {data: undefined, update: false}
and also:
layout message from socket {command: 'layout'}
onLayoutMessage payload {data: undefined, update: false}
This confirms that the payload reaching onLayoutMessage does not match what the handler expects.
Expected behavior
The layout payload should be forwarded under the key that onLayoutMessage destructures, so parseLayoutsFromServer(...) receives the actual layout data.
Possible fix
Either:
- send
{ data: cmd.data, update: ... } from ApiProvider, or
- change
onLayoutMessage to destructure { cmd, update }
I verified a runtime mismatch in the frontend layout message flow.
In
js/api/ApiProvider.js, layout messages are forwarded as:But in
js/main.js, the handler expects:So
ApiProvidersends acmdfield, whileonLayoutMessageexpectsdata.Verified runtime behavior
With temporary console logging added, I observed:
and also:
This confirms that the payload reaching
onLayoutMessagedoes not match what the handler expects.Expected behavior
The layout payload should be forwarded under the key that
onLayoutMessagedestructures, soparseLayoutsFromServer(...)receives the actual layout data.Possible fix
Either:
{ data: cmd.data, update: ... }fromApiProvider, oronLayoutMessageto destructure{ cmd, update }