fix: guard setDeep against empty keys array in Chrome profile decoration#98138
Conversation
|
Codex review: needs maintainer review before merge. Reviewed July 1, 2026, 8:25 PM ET / 00:25 UTC. Summary PR surface: Source +3. Total +3 across 1 file. Reproducibility: yes. at source level: current main's final assignment writes Review metrics: none identified. Root-cause cluster Members:
Proposal only: this assessment does not dispatch repair, suppress jobs, mutate sibling items, close, or merge anything. Merge readiness Overall follows the weaker of proof and patch quality, so missing proof can cap an otherwise strong patch. Rank-up moves:
Risk before merge
Maintainer options:
Next step before merge
Security Review detailsBest possible solution: Land this narrow guard as the candidate fix for #98465 if maintainers want empty key paths to be a no-op for the private helper. Do we have a high-confidence way to reproduce the issue? Yes at source level: current main's final assignment writes Is this the best way to solve the issue? Yes for the helper-level behavior: an early return before final indexing is the narrow local fix. A wider caller refactor is not justified because the helper is private and the only current call sites are local non-empty literal paths. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning high; reviewed against 3558391a75fd. Label changesLabel changes:
Label justifications:
Evidence reviewedPR surface: Source +3. Total +3 across 1 file. View PR surface stats
What I checked:
Likely related people:
What the crustacean ranks mean
Shiny media proof means a screenshot, video, or linked artifact directly shows the changed behavior. Runtime, network, CSP, and security claims still need visible diagnostics. How this review workflow works
|
zhangLei99586
left a comment
There was a problem hiding this comment.
@clawsweeper re-review
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper review |
2c51b19 to
0a2139c
Compare
|
@clawsweeper re-review |
|
🦞🧹 I asked ClawSweeper to review this item again. |
|
@clawsweeper re-review |
|
@clawsweeper re-review |
1 similar comment
|
@clawsweeper re-review |
|
@clawsweeper re-review |
2 similar comments
|
@clawsweeper re-review |
|
@clawsweeper re-review |
0a2139c to
342b845
Compare
When keys is empty, keys[keys.length - 1] returns undefined, and the previous ?? fallback would silently create a property with an empty string key on the target object. Add an early return so empty keys are a no-op instead of silently polluting the object.
342b845 to
c6a5303
Compare
|
Merged via squash.
|
* origin/main: test(gateway): isolate live release agent state test(plugins): repair prerelease validation fixtures fix(discord): guard JSON.parse against malformed API response bodies (#97889) fix(codex): preserve app approvals in side forks (#98812) fix(agents): don't inject A2A turns into isolated-cron sessions_send (#92257) (#92283) fix(browser): guard setDeep against empty keys array (#98138) docs(telegram): move maintainer decisions into scoped AGENTS.md fix(ios): generate light app store screenshots only fix(gateway): distinguish reachable gateway from failed status probe (#98183)
When keys is empty, keys[keys.length - 1] returns undefined, and the previous ?? fallback would silently create a property with an empty string key on the target object. Add an early return so empty keys are a no-op instead of silently polluting the object.
When keys is empty, keys[keys.length - 1] returns undefined, and the previous ?? fallback would silently create a property with an empty string key on the target object. Add an early return so empty keys are a no-op instead of silently polluting the object.
When keys is empty, keys[keys.length - 1] returns undefined, and the previous ?? fallback would silently create a property with an empty string key on the target object. Add an early return so empty keys are a no-op instead of silently polluting the object.


Related: #98465
What Problem This Solves
setDeep()with emptykeyscreatesobj[""] = valueviakeys[-1] ?? "".Why This Change Was Made
Add early
if (keys.length === 0) return;guard.User Impact
No user-visible change. Defensive guard.
Evidence
Runtime terminal proof (Node v24.13.1):
profiles.test.ts) —setDeep(obj,[],"v") → keys: [ ]