Update default conflict method to be 'ignore'.

This commit is contained in:
Greyson Parrelli
2023-05-12 09:26:44 -04:00
parent 6615bc4a2a
commit 2eff9e0230
4 changed files with 18 additions and 10 deletions

View File

@@ -292,7 +292,7 @@ class CallTable(context: Context, databaseHelper: SignalDatabase) : DatabaseTabl
TIMESTAMP to timestamp,
DELETION_TIMESTAMP to System.currentTimeMillis()
)
.run()
.run(SQLiteDatabase.CONFLICT_ABORT)
ApplicationDependencies.getDeletedCallEventManager().scheduleIfNecessary()
}
@@ -356,7 +356,7 @@ class CallTable(context: Context, databaseHelper: SignalDatabase) : DatabaseTabl
TIMESTAMP to timestamp,
RINGER to ringer
)
.run()
.run(SQLiteDatabase.CONFLICT_ABORT)
}
ApplicationDependencies.getDatabaseObserver().notifyCallUpdateObservers()
@@ -462,7 +462,7 @@ class CallTable(context: Context, databaseHelper: SignalDatabase) : DatabaseTabl
TIMESTAMP to timestamp,
RINGER to null
)
.run()
.run(SQLiteDatabase.CONFLICT_ABORT)
Log.d(TAG, "Inserted new call event from group call update message. Call Id: $callId")
} else {
@@ -670,7 +670,7 @@ class CallTable(context: Context, databaseHelper: SignalDatabase) : DatabaseTabl
TIMESTAMP to timestamp,
RINGER to ringerRecipient.toLong()
)
.run()
.run(SQLiteDatabase.CONFLICT_ABORT)
}
Log.d(TAG, "Inserted a new group ring event for $callId with event $event")

View File

@@ -2725,7 +2725,7 @@ open class MessageTable(context: Context?, databaseHelper: SignalDatabase) : Dat
READ to if (Util.isDefaultSmsProvider(context)) 0 else 1,
SMS_SUBSCRIPTION_ID to subscriptionId
)
.run()
.run(SQLiteDatabase.CONFLICT_IGNORE)
return Pair(messageId, threadId)
}
@@ -3041,6 +3041,10 @@ open class MessageTable(context: Context?, databaseHelper: SignalDatabase) : Dat
unarchive = false
)
if (messageId < 0) {
throw MmsException("Failed to insert message! Likely a duplicate.")
}
if (message.threadRecipient.isGroup) {
val members: MutableSet<RecipientId> = mutableSetOf()