mirror of
https://code.briarproject.org/briar/briar.git
synced 2026-02-17 13:19:52 +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.SHARED;
|
||||||
import static org.briarproject.bramble.api.sync.Group.Visibility.VISIBLE;
|
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.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.PENDING;
|
||||||
import static org.briarproject.bramble.api.sync.ValidationManager.State.UNKNOWN;
|
import static org.briarproject.bramble.api.sync.ValidationManager.State.UNKNOWN;
|
||||||
import static org.briarproject.bramble.db.DatabaseConstants.DB_SETTINGS_NAMESPACE;
|
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 dependentGroupId = new GroupId(rs.getBytes(3));
|
||||||
GroupId dependencyGroupId = new GroupId(rs.getBytes(4));
|
GroupId dependencyGroupId = new GroupId(rs.getBytes(4));
|
||||||
if (!dependentGroupId.equals(dependencyGroupId))
|
if (!dependentGroupId.equals(dependencyGroupId))
|
||||||
state = INVALID; // Dependency in another group
|
state = UNKNOWN; // Dependency in another group
|
||||||
}
|
}
|
||||||
dependencies.put(dependency, state);
|
dependencies.put(dependency, state);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1332,8 +1332,8 @@ public abstract class JdbcDatabaseTest extends BrambleTestCase {
|
|||||||
Map<MessageId, State> dependencies;
|
Map<MessageId, State> dependencies;
|
||||||
dependencies = db.getMessageDependencies(txn, messageId);
|
dependencies = db.getMessageDependencies(txn, messageId);
|
||||||
|
|
||||||
// The cross-group dependency should have state INVALID
|
// The cross-group dependency should have state UNKNOWN
|
||||||
assertEquals(INVALID, dependencies.get(messageId1));
|
assertEquals(UNKNOWN, dependencies.get(messageId1));
|
||||||
|
|
||||||
// The missing dependency should have state UNKNOWN
|
// The missing dependency should have state UNKNOWN
|
||||||
assertEquals(UNKNOWN, dependencies.get(messageId2));
|
assertEquals(UNKNOWN, dependencies.get(messageId2));
|
||||||
|
|||||||
Reference in New Issue
Block a user