Skip to content

fix(list): use actionStr.slice to avoid TypeError on symbol in remap handler#3356

Open
la14-1 wants to merge 2 commits intomainfrom
fix/list-action-slice-symbol-crash
Open

fix(list): use actionStr.slice to avoid TypeError on symbol in remap handler#3356
la14-1 wants to merge 2 commits intomainfrom
fix/list-action-slice-symbol-crash

Conversation

@la14-1
Copy link
Copy Markdown
Member

@la14-1 la14-1 commented Apr 24, 2026

Why: Fixes a potential TypeError crash in spawn delete when a user selects a "remap" option for a gone server. `p.select()` returns `string | symbol`; `actionStr` was already created via `String(action)` to safely handle this, but line 451 accidentally called `.slice(6)` on the raw `action` value. Symbols have no `.slice()` method and would throw at runtime.

Change: One-line fix — `action.slice(6)` → `actionStr.slice(6)`.

Found by refactor/code-health during proactive scan.

-- refactor/code-health

@la14-1 la14-1 force-pushed the fix/list-action-slice-symbol-crash branch from 0e4c26b to 2c99e32 Compare April 26, 2026 05:03
@la14-1
Copy link
Copy Markdown
Member Author

la14-1 commented Apr 28, 2026

This PR has been open for 4+ days with all CI checks passing (ShellCheck, Biome Lint, Unit Tests, Mock Tests, macOS Compatibility — all SUCCESS). It is mergeable with no conflicts.

Requesting human review when convenient.

-- spawn-refactor/pr-maintainer

@la14-1 la14-1 force-pushed the fix/list-action-slice-symbol-crash branch from 2c99e32 to cb867d6 Compare April 30, 2026 05:07
@la14-1
Copy link
Copy Markdown
Member Author

la14-1 commented May 3, 2026

This PR is ready for review. All CI checks pass and there are no merge conflicts.

-- refactor/pr-maintainer

…rror on symbol

p.select() returns string | symbol. actionStr already safely converts it
via String(), but line 451 was calling .slice() on the raw action value.
Symbols do not have .slice() and would throw a TypeError in the remap-
branch of handleGoneServer.

Agent: code-health
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@la14-1 la14-1 force-pushed the fix/list-action-slice-symbol-crash branch from cb867d6 to 52daaab Compare May 3, 2026 14:19
@la14-1
Copy link
Copy Markdown
Member Author

la14-1 commented May 3, 2026

Rebased onto main (was 4 commits behind). Clean rebase, no conflicts.

-- refactor/pr-maintainer

@la14-1
Copy link
Copy Markdown
Member Author

la14-1 commented May 4, 2026

Verified in worktree: tests pass (2236/2238, same 2 pre-existing failures as main), lint clean (biome 0 errors). PR is mergeable and ready for review.

-- refactor/pr-maintainer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants