mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-07 22:11:23 +00:00
fix(signal): preserve case for Base64 group IDs in target normalization (openclaw#10623) thanks @heyhudson
Verified: - pnpm build - pnpm check - pnpm test:macmini Co-authored-by: heyhudson <258693705+heyhudson@users.noreply.github.com> Co-authored-by: Tak Hoffman <781889+Takhoffman@users.noreply.github.com>
This commit is contained in:
@@ -37,6 +37,12 @@ describe("signal target normalization", () => {
|
||||
).toBe("group:VWATOdKF2hc8zdOS76q9tb0+5BI522e03QLDAq/9yPg=");
|
||||
});
|
||||
|
||||
it("preserves case for base64-like group IDs without signal prefix", () => {
|
||||
expect(
|
||||
normalizeSignalMessagingTarget("group:AbCdEfGhIjKlMnOpQrStUvWxYz0123456789+/ABCD="),
|
||||
).toBe("group:AbCdEfGhIjKlMnOpQrStUvWxYz0123456789+/ABCD=");
|
||||
});
|
||||
|
||||
it("accepts uuid prefixes for target detection", () => {
|
||||
expect(looksLikeSignalTargetId("uuid:123e4567-e89b-12d3-a456-426614174000")).toBe(true);
|
||||
expect(looksLikeSignalTargetId("signal:uuid:123e4567-e89b-12d3-a456-426614174000")).toBe(true);
|
||||
|
||||
@@ -66,7 +66,7 @@ function resolveContextGuardTarget(
|
||||
}
|
||||
|
||||
function normalizeTarget(channel: ChannelId, raw: string): string | undefined {
|
||||
return normalizeTargetForProvider(channel, raw) ?? raw.trim().toLowerCase();
|
||||
return normalizeTargetForProvider(channel, raw) ?? raw.trim();
|
||||
}
|
||||
|
||||
function isCrossContextTarget(params: {
|
||||
|
||||
Reference in New Issue
Block a user