diff --git a/Signal/src/ViewControllers/DebugUI/DebugUIMisc.m b/Signal/src/ViewControllers/DebugUI/DebugUIMisc.m index 66222f00e..db6296fc0 100644 --- a/Signal/src/ViewControllers/DebugUI/DebugUIMisc.m +++ b/Signal/src/ViewControllers/DebugUI/DebugUIMisc.m @@ -17,7 +17,6 @@ #import #import #import -#import #import NS_ASSUME_NONNULL_BEGIN diff --git a/SignalServiceKit/src/Messages/TSMessagesManager.m b/SignalServiceKit/src/Messages/TSMessagesManager.m index 81fa79e78..8ad350d52 100644 --- a/SignalServiceKit/src/Messages/TSMessagesManager.m +++ b/SignalServiceKit/src/Messages/TSMessagesManager.m @@ -844,15 +844,17 @@ NS_ASSUME_NONNULL_BEGIN { NSString *recipientId = incomingEnvelope.source; if (!dataMessage.hasProfileKey) { - OWSFail(@"%@ received profile key message without profile key from recipient: %@", self.tag, recipientId); + OWSFail(@"%@ received profile key message without profile key from: %@", + self.tag, + envelopeAddress(incomingEnvelope)); return; } NSData *profileKey = dataMessage.profileKey; if (profileKey.length != kAES256_KeyByteLength) { - OWSFail(@"%@ received profile key of unexpected length:%lu from recipient: %@", + OWSFail(@"%@ received profile key of unexpected length:%lu from:%@", self.tag, (unsigned long)profileKey.length, - recipientId); + envelopeAddress(incomingEnvelope)); return; } @@ -1001,12 +1003,18 @@ NS_ASSUME_NONNULL_BEGIN break; } case OWSSignalServiceProtosGroupContextTypeDeliver: { - DDLogDebug(@"%@ incoming message from: %@ for group: %@ with timestampe: %lu", - self.tag, - envelopeAddress(envelope), - groupId, - (unsigned long)timestamp); - if (body.length > 0) { + if (body.length == 0) { + DDLogWarn(@"%@ ignoring empty incoming message from: %@ for group: %@ with timestampe: %lu", + self.tag, + envelopeAddress(envelope), + groupId, + (unsigned long)timestamp); + } else { + DDLogDebug(@"%@ incoming message from: %@ for group: %@ with timestampe: %lu", + self.tag, + envelopeAddress(envelope), + groupId, + (unsigned long)timestamp); incomingMessage = [[TSIncomingMessage alloc] initWithTimestamp:timestamp inThread:gThread authorId:envelope.source @@ -1026,11 +1034,16 @@ NS_ASSUME_NONNULL_BEGIN thread = gThread; } else { - DDLogDebug(@"%@ incoming message from: %@ with timestampe: %lu", - self.tag, - envelopeAddress(envelope), - (unsigned long)timestamp); - if (body.length > 0) { + if (body.length == 0) { + DDLogWarn(@"%@ ignoring empty incoming message from: %@ with timestampe: %lu", + self.tag, + envelopeAddress(envelope), + (unsigned long)timestamp); + } else { + DDLogDebug(@"%@ incoming message from: %@ with timestampe: %lu", + self.tag, + envelopeAddress(envelope), + (unsigned long)timestamp); TSContactThread *cThread = [TSContactThread getOrCreateThreadWithContactId:envelope.source transaction:transaction relay:envelope.relay];