motia icon indicating copy to clipboard operation
motia copied to clipboard

fix:LogsPage crashes while filtering because non-string log fields cause .toLowerCase() to fail

Open Tanmay-008 opened this issue 3 months ago • 0 comments

Environment

mac

Steps to Reproduce

1.Start the Motia project . 2.Open Logs page. 3.if any log contains a non-string value in msg, traceId, or step, the UI immediately crashes with a runtime error.

Expected Behavior

The LogsPage should never crash. Filtering should safely handle all log values

Actual Behavior

When a log contains a non-string value, the filtering logic tries to run:

log.msg.toLowerCase()

which results in:

TypeError: toLowerCase is not a function

This breaks the entire Logs page.

Relevant Logs/Console Output

Uncaught TypeError: u.msg.toLowerCase is not a function
    at @motiadev_plugin-logs.js?v=57690821:1188:105
    at Array.filter (<anonymous>)
    at @motiadev_plugin-logs.js?v=57690821:1188:85
    at updateMemo (react-dom_client.js?v=57690821:6545:21)
    at Object.useMemo (react-dom_client.js?v=57690821:18969:20)
    at exports.useMemo (chunk-CISLU2WX.js?v=57690821:947:36)
    at bn (@motiadev_plugin-logs.js?v=57690821:1188:76)
    at Object.react_stack_bottom_frame (react-dom_client.js?v=57690821:18509:20)
    at renderWithHooks (react-dom_client.js?v=57690821:5654:24)
    at updateFunctionComponent (react-dom_client.js?v=57690821:7475:21)

Screenshots

No response

Motia Version

No response

Additional Context

This issue occurs because:

Log events from the stream contain mixed value types.

Zustand stores these values without validation.

The filter function assumes fields (msg, traceId, step) are always strings.

When they are null, object, or number, .toLowerCase() throws an error.

A proposed fix is to introduce a helper function like toSafeString() that converts any value to a safe string before filtering.

Tanmay-008 avatar Nov 29 '25 11:11 Tanmay-008