#1599·reactotron

Redux plugin sends `undefined` instead of `[]` for state keys on non-object paths

Author: joshuayoesCreated Mar 25, 2026Updated Mar 25, 2026

In lib/reactotron-redux/src/commandHandler.ts line 53, when a state.keys.request resolves to a non-object value (e.g. a primitive), the keys response sends undefined instead of an empty array:

typescript
type === "state.keys.request"
  ? typeof filteredObj === "object"
    ? Object.keys(filteredObj)
    : undefined  // ← should be []
  : filteredObj

This causes StateKeysResponseCommand in the desktop app to crash on keys.map(). An error boundary was added in #1598 to prevent the crash, but the payload itself is still malformed per the StateKeysResponsePayload contract which defines keys: string[].

Fix: Change undefined to [].