Fix incorrect transaction batching during conversation delete.

This commit is contained in:
Cody Henthorne
2026-03-03 09:46:39 -05:00
committed by Greyson Parrelli
parent 7fbcd17759
commit e23d575460
8 changed files with 304 additions and 60 deletions

View File

@@ -56,6 +56,13 @@ class BenchmarkCommandReceiver : BroadcastReceiver() {
BenchmarkWebSocketConnection.startWholeBatchTrace()
BenchmarkWebSocketConnection.releaseMessages()
}
"delete-thread" -> {
val pendingResult = goAsync()
Thread {
handleDeleteThread()
pendingResult.finish()
}.start()
}
else -> Log.w(TAG, "Unknown command: $command")
}
}
@@ -144,6 +151,20 @@ class BenchmarkCommandReceiver : BroadcastReceiver() {
}
}
private fun handleDeleteThread() {
val threadId = SignalDatabase.threads.getRecentConversationList(1, false, false).use { cursor ->
if (cursor.moveToFirst()) {
cursor.getLong(cursor.getColumnIndexOrThrow("_id"))
} else {
Log.w(TAG, "No active threads found for deletion benchmark")
return
}
}
Log.i(TAG, "Deleting thread $threadId")
SignalDatabase.threads.deleteConversation(threadId, syncThreadDelete = false)
Log.i(TAG, "Thread $threadId deleted")
}
private fun getOutgoingGroupMessageTimestamps(): List<Long> {
val groupId = GroupId.v2(Harness.groupMasterKey)
val groupRecipient = Recipient.externalGroupExact(groupId)