More QA Fixes

• Fixed an issue where "this message was deleted locally" couldn't be overwritten with "this message was deleted"
• Backported a libSession fix for the current config being incorrectly removed from the swarm
pull/894/head
Morgan Pretty 3 months ago
parent bcbe7ec11c
commit e8c20ef8ee

@ -1 +1 @@
Subproject commit bf7c010b5e857e4ab35c4d8f819ccf90ac595fdb
Subproject commit b57c8a5604185b0a7d17fff9b62fb21c7ca31719

@ -7916,7 +7916,7 @@
CLANG_WARN__ARC_BRIDGE_CAST_NONARC = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "iPhone Developer";
CURRENT_PROJECT_VERSION = 527;
CURRENT_PROJECT_VERSION = 528;
ENABLE_BITCODE = NO;
ENABLE_STRICT_OBJC_MSGSEND = YES;
ENABLE_TESTABILITY = YES;
@ -7992,7 +7992,7 @@
CLANG_WARN__ARC_BRIDGE_CAST_NONARC = YES;
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
CODE_SIGN_IDENTITY = "iPhone Distribution";
CURRENT_PROJECT_VERSION = 527;
CURRENT_PROJECT_VERSION = 528;
ENABLE_BITCODE = NO;
ENABLE_MODULE_VERIFIER = YES;
ENABLE_STRICT_OBJC_MSGSEND = YES;

@ -1424,9 +1424,12 @@ public extension Interaction {
try interactionInfo.grouped(by: { $0.variant }).forEach { variant, info in
let targetVariant: Interaction.Variant = {
switch (variant, localOnly) {
case (.standardOutgoing, true), (.standardOutgoingDeletedLocally, _): return .standardOutgoingDeletedLocally
case (.standardOutgoing, false), (.standardOutgoingDeleted, _): return .standardOutgoingDeleted
case (_, true), (.standardIncomingDeletedLocally, _): return .standardIncomingDeletedLocally
case (.standardOutgoing, true), (.standardOutgoingDeletedLocally, true):
return .standardOutgoingDeletedLocally
case (.standardOutgoing, false), (.standardOutgoingDeletedLocally, false), (.standardOutgoingDeleted, _):
return .standardOutgoingDeleted
case (.standardIncoming, true), (.standardIncomingDeletedLocally, true):
return .standardIncomingDeletedLocally
default: return .standardIncomingDeleted
}
}()
@ -1435,7 +1438,6 @@ public extension Interaction {
.filter(ids: info.map { $0.id })
.updateAll(
db,
Interaction.Columns.serverHash.set(to: nil),
Interaction.Columns.variant.set(to: targetVariant),
Interaction.Columns.body.set(to: nil),
Interaction.Columns.wasRead.set(to: true),

@ -671,14 +671,14 @@ public extension LibSession {
try groupedMessages
.sorted { lhs, rhs in lhs.key.namespace.processingOrder < rhs.key.namespace.processingOrder }
.forEach { variant, message in
.forEach { variant, messages in
let sessionId: SessionId = SessionId(hex: swarmPublicKey, dumpVariant: variant)
let config: Config? = configStore[sessionId, variant]
do {
// Merge the messages (if it doesn't merge anything then don't bother trying
// to handle the result)
guard let latestServerTimestampMs: Int64 = try config?.merge(message) else { return }
guard let latestServerTimestampMs: Int64 = try config?.merge(messages) else { return }
// Apply the updated states to the database
switch variant {

@ -402,36 +402,39 @@ public struct MessageViewModel: FetchableRecordWithRowId, Decodable, Equatable,
)
}()
let (positionInCluster, isOnlyMessageInCluster): (Position, Bool) = {
let isFirstInCluster: Bool = (
prevModel == nil ||
shouldShowDateBeforeThisModel || (
self.variant == .standardOutgoing &&
prevModel?.variant != .standardOutgoing
let isSenderVariantConsistent: Bool = (
(
(
self.variant == .standardOutgoing ||
self.variant == .standardOutgoingDeleted ||
self.variant == .standardOutgoingDeletedLocally
) && (
prevModel?.variant != .standardOutgoing ||
prevModel?.variant != .standardOutgoingDeleted ||
prevModel?.variant != .standardOutgoingDeletedLocally
)
) || (
(
self.variant == .standardIncoming ||
self.variant == .standardIncomingDeleted
self.variant == .standardIncomingDeleted ||
self.variant == .standardIncomingDeletedLocally
) && (
prevModel?.variant != .standardIncoming &&
prevModel?.variant != .standardIncomingDeleted
prevModel?.variant != .standardIncomingDeleted &&
prevModel?.variant != .standardIncomingDeletedLocally
)
) ||
)
)
let isFirstInCluster: Bool = (
prevModel == nil ||
shouldShowDateBeforeThisModel ||
isSenderVariantConsistent ||
self.authorId != prevModel?.authorId
)
let isLastInCluster: Bool = (
nextModel == nil ||
shouldShowDateBeforeNextModel || (
self.variant == .standardOutgoing &&
nextModel?.variant != .standardOutgoing
) || (
(
self.variant == .standardIncoming ||
self.variant == .standardIncomingDeleted
) && (
nextModel?.variant != .standardIncoming &&
nextModel?.variant != .standardIncomingDeleted
)
) ||
shouldShowDateBeforeNextModel ||
isSenderVariantConsistent ||
self.authorId != nextModel?.authorId
)

Loading…
Cancel
Save