mirror of
https://github.com/signalapp/Signal-Android.git
synced 2025-12-24 04:58:45 +00:00
Fix archive handling of mixed error send statuses, add more tests.
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -171,6 +171,11 @@ class ArchiveImportExportTests {
|
||||
runTests { it.startsWith("chat_item_standard_message_standard_attachments_") }
|
||||
}
|
||||
|
||||
// @Test
|
||||
fun chatItemStandardMessageGroupTextOnly() {
|
||||
runTests { it.startsWith("chat_item_standard_message_group_text_only_") }
|
||||
}
|
||||
|
||||
// @Test
|
||||
fun chatItemStandardMessageTextOnly() {
|
||||
runTests { it.startsWith("chat_item_standard_message_text_only_") }
|
||||
|
||||
@@ -1379,7 +1379,7 @@ private fun List<GroupReceiptTable.GroupReceiptInfo>?.toRemoteSendStatus(message
|
||||
reason = SendStatus.Failed.FailureReason.NETWORK
|
||||
)
|
||||
}
|
||||
MessageTypes.isFailedMessageType(messageRecord.type) -> {
|
||||
it.status == GroupReceiptTable.STATUS_FAILED -> {
|
||||
statusBuilder.failed = SendStatus.Failed(
|
||||
reason = SendStatus.Failed.FailureReason.UNKNOWN
|
||||
)
|
||||
|
||||
@@ -1073,7 +1073,7 @@ class ChatItemArchiveImporter(
|
||||
this.read != null -> GroupReceiptTable.STATUS_READ
|
||||
this.viewed != null -> GroupReceiptTable.STATUS_VIEWED
|
||||
this.skipped != null -> GroupReceiptTable.STATUS_SKIPPED
|
||||
this.failed != null -> GroupReceiptTable.STATUS_UNKNOWN
|
||||
this.failed != null -> GroupReceiptTable.STATUS_FAILED
|
||||
else -> GroupReceiptTable.STATUS_UNKNOWN
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,6 +36,7 @@ class GroupReceiptTable(context: Context?, databaseHelper: SignalDatabase?) : Da
|
||||
const val STATUS_READ = 2
|
||||
const val STATUS_VIEWED = 3
|
||||
const val STATUS_SKIPPED = 4
|
||||
const val STATUS_FAILED = 5
|
||||
|
||||
const val CREATE_TABLE = """
|
||||
CREATE TABLE $TABLE_NAME (
|
||||
|
||||
@@ -198,6 +198,8 @@ public final class MessageDetailsRepository {
|
||||
return RecipientDeliveryStatus.Status.VIEWED;
|
||||
} else if (groupStatus == GroupReceiptTable.STATUS_SKIPPED) {
|
||||
return RecipientDeliveryStatus.Status.SKIPPED;
|
||||
} else if (groupStatus == GroupReceiptTable.STATUS_FAILED) {
|
||||
return RecipientDeliveryStatus.Status.SKIPPED;
|
||||
}
|
||||
|
||||
throw new AssertionError();
|
||||
|
||||
Reference in New Issue
Block a user