fix: harden session error handling, normalizer null guard, extract redis-connection
- Wrap groupFetchAllParticipating in try/catch to prevent unhandled rejection on connect - Catch errors from async onMessage/onGroups callbacks via Promise.resolve().catch - Return null from normalizer when key.id is missing (prevents empty upsert key collision) - Extract parseRedisUrl to redis-connection.ts to eliminate duplication Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -35,10 +35,13 @@ export function normalizeMessage(msg: proto.IWebMessageInfo): NormalizedMessage
|
||||
|
||||
if (!msg.message) return null;
|
||||
|
||||
const platformMsgId = key.id;
|
||||
if (!platformMsgId) return null;
|
||||
|
||||
const content = extractText(msg);
|
||||
|
||||
return {
|
||||
platformMsgId: key.id ?? '',
|
||||
platformMsgId,
|
||||
sourceGroupJid: remoteJid,
|
||||
senderJid: key.participant ?? '',
|
||||
senderName: msg.pushName ?? undefined,
|
||||
|
||||
Reference in New Issue
Block a user