mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-17 05:09:53 +01:00
DatabaseComponent.setSeen() should call setStatusSeenIfVisible().
Otherwise an exception may be thrown if an offered message is no longer in the DB.
This commit is contained in:
@@ -1163,7 +1163,7 @@ DatabaseCleaner.Callback {
|
|||||||
T txn = db.startTransaction();
|
T txn = db.startTransaction();
|
||||||
try {
|
try {
|
||||||
for(MessageId m : seen) {
|
for(MessageId m : seen) {
|
||||||
db.setStatus(txn, c, m, Status.SEEN);
|
db.setStatusSeenIfVisible(txn, c, m);
|
||||||
}
|
}
|
||||||
db.commitTransaction(txn);
|
db.commitTransaction(txn);
|
||||||
} catch(DbException e) {
|
} catch(DbException e) {
|
||||||
|
|||||||
@@ -1509,7 +1509,7 @@ public abstract class DatabaseComponentTest extends TestCase {
|
|||||||
allowing(database).containsContact(txn, contactId);
|
allowing(database).containsContact(txn, contactId);
|
||||||
will(returnValue(true));
|
will(returnValue(true));
|
||||||
// setSeen(contactId, Collections.singleton(messageId))
|
// setSeen(contactId, Collections.singleton(messageId))
|
||||||
oneOf(database).setStatus(txn, contactId, messageId, Status.SEEN);
|
oneOf(database).setStatusSeenIfVisible(txn, contactId, messageId);
|
||||||
}});
|
}});
|
||||||
DatabaseComponent db = createDatabaseComponent(database, cleaner);
|
DatabaseComponent db = createDatabaseComponent(database, cleaner);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user