fix: signal handle dataMessage.reaction safely (#637) (thanks @neist)
This commit is contained in:
@@ -35,6 +35,7 @@
|
|||||||
- iOS/Android: enable stricter concurrency/lint checks; fix Swift 6 strict concurrency issues + Android lint errors (ExifInterface, obsolete SDK check). (#662) — thanks @KristijanJovanovski.
|
- iOS/Android: enable stricter concurrency/lint checks; fix Swift 6 strict concurrency issues + Android lint errors (ExifInterface, obsolete SDK check). (#662) — thanks @KristijanJovanovski.
|
||||||
- iOS/macOS: share `AsyncTimeout`, require explicit `bridgeStableID` on connect, and harden tool display defaults (avoids missing-resource label fallbacks).
|
- iOS/macOS: share `AsyncTimeout`, require explicit `bridgeStableID` on connect, and harden tool display defaults (avoids missing-resource label fallbacks).
|
||||||
- Telegram: serialize media-group processing to avoid missed albums under load.
|
- Telegram: serialize media-group processing to avoid missed albums under load.
|
||||||
|
- Signal: handle `dataMessage.reaction` events (signal-cli SSE) to avoid broken attachment errors. (#637) — thanks @neist.
|
||||||
- Docs: showcase entries for ParentPay, R2 Upload, iOS TestFlight, and Oura Health. (#650) — thanks @henrino3.
|
- Docs: showcase entries for ParentPay, R2 Upload, iOS TestFlight, and Oura Health. (#650) — thanks @henrino3.
|
||||||
|
|
||||||
## 2026.1.9
|
## 2026.1.9
|
||||||
|
|||||||
@@ -144,6 +144,20 @@ function resolveSignalReactionTargets(
|
|||||||
return targets;
|
return targets;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function isSignalReactionMessage(
|
||||||
|
reaction: SignalReactionMessage | null | undefined,
|
||||||
|
): reaction is SignalReactionMessage {
|
||||||
|
if (!reaction) return false;
|
||||||
|
const emoji = reaction.emoji?.trim();
|
||||||
|
const timestamp = reaction.targetSentTimestamp;
|
||||||
|
const hasTarget = Boolean(
|
||||||
|
reaction.targetAuthor?.trim() || reaction.targetAuthorUuid?.trim(),
|
||||||
|
);
|
||||||
|
return Boolean(
|
||||||
|
emoji && typeof timestamp === "number" && timestamp > 0 && hasTarget,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
function shouldEmitSignalReactionNotification(params: {
|
function shouldEmitSignalReactionNotification(params: {
|
||||||
mode?: SignalReactionNotificationMode;
|
mode?: SignalReactionNotificationMode;
|
||||||
account?: string | null;
|
account?: string | null;
|
||||||
@@ -404,8 +418,11 @@ export async function monitorSignalProvider(
|
|||||||
}
|
}
|
||||||
const dataMessage =
|
const dataMessage =
|
||||||
envelope.dataMessage ?? envelope.editMessage?.dataMessage;
|
envelope.dataMessage ?? envelope.editMessage?.dataMessage;
|
||||||
const reaction =
|
const reaction = isSignalReactionMessage(envelope.reactionMessage)
|
||||||
envelope.reactionMessage ?? dataMessage?.reaction ?? null;
|
? envelope.reactionMessage
|
||||||
|
: isSignalReactionMessage(dataMessage?.reaction)
|
||||||
|
? dataMessage?.reaction
|
||||||
|
: null;
|
||||||
const messageText = (dataMessage?.message ?? "").trim();
|
const messageText = (dataMessage?.message ?? "").trim();
|
||||||
const quoteText = dataMessage?.quote?.text?.trim() ?? "";
|
const quoteText = dataMessage?.quote?.text?.trim() ?? "";
|
||||||
const hasBodyContent =
|
const hasBodyContent =
|
||||||
|
|||||||
Reference in New Issue
Block a user