mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-12 10:49:06 +01:00
Report UNKNOWN state for cross-group dependencies.
This causes the validator to treat the dependent message in the same way regardless of whether there is a subscription to the dependency's group.
This commit is contained in:
@@ -57,7 +57,6 @@ import static org.briarproject.bramble.api.sync.Group.Visibility.INVISIBLE;
|
||||
import static org.briarproject.bramble.api.sync.Group.Visibility.SHARED;
|
||||
import static org.briarproject.bramble.api.sync.Group.Visibility.VISIBLE;
|
||||
import static org.briarproject.bramble.api.sync.ValidationManager.State.DELIVERED;
|
||||
import static org.briarproject.bramble.api.sync.ValidationManager.State.INVALID;
|
||||
import static org.briarproject.bramble.api.sync.ValidationManager.State.PENDING;
|
||||
import static org.briarproject.bramble.api.sync.ValidationManager.State.UNKNOWN;
|
||||
import static org.briarproject.bramble.db.DatabaseConstants.DB_SETTINGS_NAMESPACE;
|
||||
@@ -1681,7 +1680,7 @@ abstract class JdbcDatabase implements Database<Connection> {
|
||||
GroupId dependentGroupId = new GroupId(rs.getBytes(3));
|
||||
GroupId dependencyGroupId = new GroupId(rs.getBytes(4));
|
||||
if (!dependentGroupId.equals(dependencyGroupId))
|
||||
state = INVALID; // Dependency in another group
|
||||
state = UNKNOWN; // Dependency in another group
|
||||
}
|
||||
dependencies.put(dependency, state);
|
||||
}
|
||||
|
||||
@@ -1332,8 +1332,8 @@ public abstract class JdbcDatabaseTest extends BrambleTestCase {
|
||||
Map<MessageId, State> dependencies;
|
||||
dependencies = db.getMessageDependencies(txn, messageId);
|
||||
|
||||
// The cross-group dependency should have state INVALID
|
||||
assertEquals(INVALID, dependencies.get(messageId1));
|
||||
// The cross-group dependency should have state UNKNOWN
|
||||
assertEquals(UNKNOWN, dependencies.get(messageId1));
|
||||
|
||||
// The missing dependency should have state UNKNOWN
|
||||
assertEquals(UNKNOWN, dependencies.get(messageId2));
|
||||
|
||||
Reference in New Issue
Block a user