fix(signal): preserve case for group IDs (base64 is case-sensitive)

fix(windows): add shell option for spawn on Windows to fix npm ENOENT

Fixes #4537, Fixes #4557
This commit is contained in:
ThanhNguyxn 2026-01-30 17:12:02 +07:00
parent bc432d8435
commit aaefee78de
2 changed files with 6 additions and 3 deletions

View File

@ -8,21 +8,23 @@ export function normalizeSignalMessagingTarget(raw: string): string | undefined
if (!normalized) return undefined;
const lower = normalized.toLowerCase();
if (lower.startsWith("group:")) {
// Preserve case for group IDs - base64 is case-sensitive
const id = normalized.slice("group:".length).trim();
return id ? `group:${id}`.toLowerCase() : undefined;
return id ? `group:${id}` : undefined;
}
if (lower.startsWith("username:")) {
const id = normalized.slice("username:".length).trim();
return id ? `username:${id}`.toLowerCase() : undefined;
return id ? `username:${id.toLowerCase()}` : undefined;
}
if (lower.startsWith("u:")) {
const id = normalized.slice("u:".length).trim();
return id ? `username:${id}`.toLowerCase() : undefined;
return id ? `username:${id.toLowerCase()}` : undefined;
}
if (lower.startsWith("uuid:")) {
const id = normalized.slice("uuid:".length).trim();
return id ? id.toLowerCase() : undefined;
}
// Phone numbers and other targets can be lowercased
return normalized.toLowerCase();
}

View File

@ -85,6 +85,7 @@ export async function runCommandWithTimeout(
cwd,
env: resolvedEnv,
windowsVerbatimArguments,
shell: process.platform === "win32",
});
// Spawn with inherited stdin (TTY) so tools like `pi` stay interactive when needed.
return await new Promise((resolve, reject) => {