From 40b2ecf580cb06558833df5293c489e4aad27b3a Mon Sep 17 00:00:00 2001 From: Matthew Chen Date: Tue, 28 Nov 2017 14:44:57 -0500 Subject: [PATCH] Add debug UI for hallucinating lots of large attachments to stress shared data migration. --- Signal/src/ViewControllers/DebugUI/DebugUIMessages.m | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Signal/src/ViewControllers/DebugUI/DebugUIMessages.m b/Signal/src/ViewControllers/DebugUI/DebugUIMessages.m index 1c230fd42..0110c41e2 100644 --- a/Signal/src/ViewControllers/DebugUI/DebugUIMessages.m +++ b/Signal/src/ViewControllers/DebugUI/DebugUIMessages.m @@ -140,6 +140,14 @@ NS_ASSUME_NONNULL_BEGIN actionBlock:^{ [DebugUIMessages createFakeLargeOutgoingAttachments:100 thread:thread]; }], + [OWSTableItem itemWithTitle:@"Create 1k fake large attachments" + actionBlock:^{ + [DebugUIMessages createFakeLargeOutgoingAttachments:1000 thread:thread]; + }], + [OWSTableItem itemWithTitle:@"Create 10k fake large attachments" + actionBlock:^{ + [DebugUIMessages createFakeLargeOutgoingAttachments:10000 thread:thread]; + }], [OWSTableItem itemWithTitle:@"Send text/x-signal-plain" actionBlock:^{ [DebugUIMessages sendOversizeTextMessage:thread]; @@ -1072,10 +1080,11 @@ NS_ASSUME_NONNULL_BEGIN if (filename) { message.attachmentFilenameMap[attachmentStream.uniqueId] = filename; } + [message updateWithMessageState:TSOutgoingMessageStateUnsent transaction:transaction]; [message saveWithTransaction:transaction]; }]; - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)1.f * NSEC_PER_SEC), dispatch_get_main_queue(), ^{ + dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{ [self createFakeLargeOutgoingAttachments:counter - 1 thread:thread]; }); }