IPS-168 Doc all asserts, make sure release builds do the right thing as well

IPS-168
Dirk Zimmermann 1 year ago
parent 811ca37df5
commit fff4bc1cad

@ -130,8 +130,7 @@
return;
}
// Message IDs must be unique, or we'll have problems. Let's find out rather sooner,
// during development, than later.
// Make sure there are not already callbacks existing for the message ID.
PEPTransportStatusCallbacks *existingCallbacks = [self.messageCallbacks objectForKey:messageID];
NSAssert(existingCallbacks == nil,
@"Sending a message with a message ID that is currently in the process of sending is not supported");

@ -19,9 +19,8 @@
transportStatusCode:&statusCodeFromUnderlyingTransport
error:&error];
if (message == nil) {
// Weird case, but nothing to relay to the delegate.
// For now, assume implementation error.
NSAssert(NO, @"Underlying transport signaled new message, but could not read it");
// Weird case, but nothing to relay to the delegate, so ignore.
NSAssert(NO, @"Underlying transport signaled new message, but there was none");
} else {
[self.transportDelegate signalIncomingMessage:message
transportID:transportID

@ -41,8 +41,12 @@
statusCode:(PEPTransportStatusCode)statusCode {
PEPTransportStatusCallbacks *callbacks = [self findAndRemoveCallbacksForMessageID:messageID];
// That would look like a developer error.
// If we don't find the matching callbacks for this message ID,
// there's nothing we can do.
NSAssert(callbacks != nil, @"Got called with message send result, but no callback");
if (callbacks == nil) {
return;
}
if ([PEPTransportStatusCodeUtil isErrorStatusCode:statusCode] ||
[PEPTransportStatusCodeUtil isCriticalErrorStatusCode:statusCode]) {

Loading…
Cancel
Save