infinitered / infinitered/reactotron
Redux plugin sends `undefined` instead of `[]` for state keys on non-object paths
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 15.6k
- Forks
- 972
- PR merge metrics
- No merged PRs in 30d
Description
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:
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 [].
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Open lib/reactotron-redux/src/commandHandler.ts at line 53 and inspect the state.keys.request branch. Confirm how non-object state values are handled and compare the response with the StateKeysResponsePayload contract. Done means the branch returns an empty array for non-object values, preserving a string-array keys payload.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- redux, typescript
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 88/100