Skip to content

fix(cli): validate metadata.gatewayName type in normalizeSession #1283

@ericksoa

Description

@ericksoa

Bug

In src/lib/onboard-session.ts, normalizeSession copies metadata.gatewayName without checking its type. A persisted payload like { "metadata": { "gatewayName": 123 } } survives normalization, so loadSession() can return a Session where metadata.gatewayName is not a string.

Fix

Add typeof gatewayName === "string" check before copying it into the normalized session.

Found by

CodeRabbit review on #1272. Pre-existing from original JS.

Metadata

Metadata

Assignees

Labels

area: cliCommand line interface, flags, terminal UX, or output

Type

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions