Skip to content

Commit

Permalink
Ensure one row per recipient in getRecipientSettingsForSync().
Browse files Browse the repository at this point in the history
Technically there's no unique constraint in ThreadDatabase to guarantee
only one thread per recipient. We saw a crash that indicated that one
user has two threads for the same recipient. That's not true for any of
my devices. Still, best to play it safe here while we try to figure out
why this is happening.
  • Loading branch information
greyson-signal committed Oct 9, 2020
1 parent 0ca2c78 commit 597d16f
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1079,7 +1079,7 @@ private List<RecipientSettings> getRecipientSettingsForSync(@Nullable String que
.flatMap(Stream::of)
.toArray(String[]::new);

try (Cursor cursor = db.query(table, columns, query, args, null, null, null)) {
try (Cursor cursor = db.query(table, columns, query, args, TABLE_NAME + "." + ID, null, null)) {
while (cursor != null && cursor.moveToNext()) {
out.add(getRecipientSettings(context, cursor));
}
Expand Down

0 comments on commit 597d16f

Please sign in to comment.