ly-wang19
b9a7bf83a4
fix(device-pairing): guard role normalization against non-string entries ( #93504 )
...
normalizeRoleList in src/shared/device-pairing-access.ts called .trim() on every roles[] entry and the singular role without a typeof === "string" guard, so a malformed/legacy on-disk pairing record (roles/role loaded via blind-cast JSON in coercePairingStateRecord) threw "TypeError: role.trim is not a function" and crashed resolvePendingDeviceApprovalState -- and thus `openclaw devices list`, which calls it per pending request with no try/catch.
Route each item through the shared non-string-safe normalizer normalizeUniqueSingleOrTrimmedStringList, mirroring the #90654/#92178 fix that already guarded the sibling mergeRoles/mergeScopes (src/infra/device-pairing.ts) and the in-file scopes path (normalizeDeviceAuthScopes). Non-string entries are dropped; valid roles are still trimmed, deduped, and sorted. Net -10 LOC.
Co-authored-by: ly-wang19 <ly-wang19@users.noreply.github.com >
Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com >
2026-06-22 18:56:01 +08:00
..
2026-06-19 01:21:31 +08:00
2026-06-22 14:08:46 +08:00
2026-06-03 15:20:39 -07:00
2026-06-04 20:02:33 -04:00
2026-06-03 15:20:39 -07:00
2026-06-11 11:15:47 +09:00
2026-06-10 08:08:35 -07:00
2026-06-17 16:03:38 +08:00
2026-06-04 20:02:33 -04:00
2026-06-04 20:02:33 -04:00
2026-06-04 20:02:33 -04:00
2026-06-17 15:59:58 +08:00
2026-06-09 16:45:14 +09:00
2026-06-17 15:59:58 +08:00
2026-06-04 20:02:33 -04:00
2026-05-31 22:32:28 -04:00
2026-06-04 20:02:33 -04:00
2026-06-04 20:02:33 -04:00
2026-06-04 20:02:33 -04:00
2026-06-17 20:31:20 +08:00
2026-06-04 20:02:33 -04:00
2026-06-17 16:03:38 +08:00
2026-05-31 22:32:28 -04:00
2026-06-04 20:02:33 -04:00
2026-06-10 08:08:35 -07:00
2026-06-04 20:02:33 -04:00
2026-06-04 20:02:33 -04:00
2026-06-04 20:02:33 -04:00
2026-05-31 14:37:41 +01:00
2026-06-04 20:02:33 -04:00
2026-06-04 20:02:33 -04:00
2026-06-22 18:56:01 +08:00
2026-06-22 18:56:01 +08:00
2026-06-04 20:02:33 -04:00
2026-06-04 20:02:33 -04:00
2026-06-04 20:02:33 -04:00
2026-06-17 16:03:38 +08:00
2026-06-22 09:37:09 +08:00
2026-06-04 20:02:33 -04:00
2026-06-04 20:02:33 -04:00
2026-06-04 20:02:33 -04:00
2026-06-04 20:02:33 -04:00
2026-06-04 20:02:33 -04:00
2026-06-04 20:02:33 -04:00
2026-06-04 20:02:33 -04:00
2026-06-03 15:20:39 -07:00
2026-06-04 20:02:33 -04:00
2026-05-31 22:32:28 -04:00
2026-06-04 20:02:33 -04:00
2026-06-11 01:10:20 +09:00
2026-06-11 01:10:20 +09:00
2026-06-04 20:02:33 -04:00
2026-06-04 20:02:33 -04:00
2026-06-17 16:03:38 +08:00
2026-06-04 20:02:33 -04:00
2026-06-21 14:23:43 +08:00
2026-05-31 22:32:28 -04:00
2026-06-10 08:08:35 -07:00
2026-06-03 15:20:39 -07:00
2026-06-04 20:02:33 -04:00
2026-06-04 20:02:33 -04:00
2026-06-04 20:02:33 -04:00
2026-06-04 20:02:33 -04:00
2026-06-13 17:40:18 -07:00
2026-06-19 09:41:52 +08:00
2026-06-19 09:41:52 +08:00
2026-06-17 16:03:38 +08:00
2026-06-04 20:02:33 -04:00
2026-06-04 20:02:33 -04:00
2026-06-03 15:20:39 -07:00
2026-06-09 16:45:14 +09:00
2026-06-04 20:02:33 -04:00
2026-06-04 20:02:33 -04:00
2026-06-17 16:06:41 +08:00
2026-06-04 20:02:33 -04:00
2026-06-04 20:02:33 -04:00
2026-06-03 15:20:39 -07:00
2026-06-04 20:02:33 -04:00
2026-06-04 20:02:33 -04:00
2026-06-19 21:36:52 +08:00
2026-06-19 21:36:52 +08:00
2026-06-03 15:20:39 -07:00
2026-06-03 15:20:39 -07:00
2026-06-04 20:02:33 -04:00
2026-06-03 15:20:39 -07:00
2026-06-03 15:20:39 -07:00
2026-06-03 15:20:39 -07:00
2026-06-04 20:02:33 -04:00
2026-06-04 20:02:33 -04:00
2026-06-17 16:03:38 +08:00
2026-06-04 20:02:33 -04:00
2026-06-03 15:20:39 -07:00
2026-06-04 20:02:33 -04:00
2026-06-17 16:06:41 +08:00
2026-06-04 20:02:33 -04:00
2026-06-04 20:02:33 -04:00
2026-06-04 20:02:33 -04:00
2026-06-17 18:56:25 +08:00
2026-06-04 20:02:33 -04:00
2026-06-03 15:20:39 -07:00
2026-06-17 16:06:41 +08:00
2026-06-04 20:02:33 -04:00
2026-06-04 20:02:33 -04:00
2026-06-04 20:02:33 -04:00