You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix incoming messages being added twice to the virtualizingcollection's cache lines
Off-by-one errors are fun! Since incoming messages are being saved before adding, we were fetching them from the database when creating the cache line AND appending it.
Copy file name to clipboardExpand all lines: Signal-Windows/Controls/VirtualizedMessagesCollection.cs
+13-1Lines changed: 13 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -67,16 +67,28 @@ public object this[int index]
67
67
68
68
publicobjectSyncRoot=>this;
69
69
70
+
/// <summary>
71
+
/// "Adds" a SignalMessageContainer to this virtualized collection.</summary>
72
+
/// <remarks>
73
+
/// The method may (if incoming) or may not (if outgoing) already be present in the database, so we explicitly insert at the correct position in the cache line.
74
+
/// Count is mapped to the SignalConversation's MessagesCount, so callers must update appropriately before calling this method, and no async method must be called in between.</remarks>
75
+
/// <param name="value">The object to add to the VirtualizedMessagesCollection.</param>
76
+
/// <returns>The position into which the new element was inserted, or -1 to indicate that the item was not inserted into the collection.</returns>
0 commit comments