mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
CR: add debug asserts
This commit is contained in:
parent
81bc357bbb
commit
6232b1ef67
|
@ -602,6 +602,10 @@ static const int kYapDatabaseRangeMinLength = 0;
|
|||
}
|
||||
|
||||
for (TSOutgoingMessage *unsavedOutgoingMessage in self.unsavedOutgoingMessages) {
|
||||
// unsavedOutgoingMessages should only exist for a short period (usually 30-50ms) before
|
||||
// they are saved and moved into the `persistedViewItems`
|
||||
OWSAssertDebug(
|
||||
unsavedOutgoingMessage.timestampForSorting >= ([NSDate ows_millisecondTimeStamp] - 1 * kSecondInMs));
|
||||
NSUInteger index = [rowChanges indexOfObjectPassingTest:^BOOL(
|
||||
YapDatabaseViewRowChange *_Nonnull rowChange, NSUInteger idx, BOOL *_Nonnull stop) {
|
||||
return [rowChange.collectionKey.key isEqualToString:unsavedOutgoingMessage.uniqueId];
|
||||
|
|
|
@ -83,7 +83,7 @@ NS_ASSUME_NONNULL_BEGIN
|
|||
quotedMessage:[quotedReplyModel buildQuotedMessageForSending]];
|
||||
|
||||
[BenchManager benchAsyncWithTitle:@"Saving outgoing message" block:^(void (^benchmarkCompletion)(void)) {
|
||||
// To avoid blocking the send flow, we disapatch an async write from within this read transaction
|
||||
// To avoid blocking the send flow, we dispatch an async write from within this read transaction
|
||||
[self.dbConnection asyncReadWriteWithBlock:^(YapDatabaseReadWriteTransaction * _Nonnull writeTransaction) {
|
||||
[message saveWithTransaction:writeTransaction];
|
||||
[self.messageSenderJobQueue addMessage:message transaction:writeTransaction];
|
||||
|
|
Loading…
Reference in a new issue