

























@@ -2233,6 +2233,56 @@ describe("BlueBubbles webhook monitor", () => {
22332233expect(mockEnqueueSystemEvent).not.toHaveBeenCalled();
22342234});
223522352236+it("drops group reactions that arrive with no chat identifiers", async () => {
2237+// Real-world failure mode: BlueBubbles fires a reaction webhook with
2238+// isGroup=true but omits chatGuid AND chatId AND chatIdentifier. The
2239+// legacy code falls peerId back to the literal string "group" and
2240+// resolves a session key unrelated to any real binding; if isGroup
2241+// had been misclassified as false the same payload would have been
2242+// routed to the sender's DM session instead — surfacing a group
2243+// tapback inside an unrelated 1:1 transcript. Either way the event
2244+// cannot be routed correctly, so drop it.
2245+mockEnqueueSystemEvent.mockClear();
2246+mockResolveRequireMention.mockReturnValue(false);
2247+2248+setupWebhookTarget({
2249+account: createMockAccount({ groupPolicy: "open" }),
2250+});
2251+2252+const payload = createTimestampedMessageReactionPayloadForTest({
2253+isGroup: true,
2254+// chatGuid / chatId / chatIdentifier intentionally omitted
2255+associatedMessageType: 2000,
2256+handle: { address: "+15559999999" },
2257+});
2258+2259+await dispatchWebhookPayload(payload);
2260+2261+expect(mockEnqueueSystemEvent).not.toHaveBeenCalled();
2262+});
2263+2264+it("still enqueues group reactions when at least one chat identifier is present", async () => {
2265+// Sanity check: the drop guard must not fire when the webhook does
2266+// include a chatGuid.
2267+mockEnqueueSystemEvent.mockClear();
2268+mockResolveRequireMention.mockReturnValue(false);
2269+2270+setupWebhookTarget({
2271+account: createMockAccount({ groupPolicy: "open" }),
2272+});
2273+2274+const payload = createTimestampedMessageReactionPayloadForTest({
2275+isGroup: true,
2276+chatGuid: "iMessage;+;chat-known-123",
2277+associatedMessageType: 2000,
2278+handle: { address: "+15559999999" },
2279+});
2280+2281+await dispatchWebhookPayload(payload);
2282+2283+expect(mockEnqueueSystemEvent).toHaveBeenCalled();
2284+});
2285+22362286it("maps reaction types to correct emojis", async () => {
22372287mockEnqueueSystemEvent.mockClear();
22382288此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。