Commit 2e570ba5 authored by akwizgran's avatar akwizgran

Rename client version to major version.

parent cadb1798
......@@ -12,19 +12,19 @@ public interface ContactGroupFactory {
/**
* Creates a group that is not shared with any contacts.
*/
Group createLocalGroup(ClientId clientId, int clientVersion);
Group createLocalGroup(ClientId clientId, int majorVersion);
/**
* Creates a group for the given client to share with the given contact.
*/
Group createContactGroup(ClientId clientId, int clientVersion,
Group createContactGroup(ClientId clientId, int majorVersion,
Contact contact);
/**
* Creates a group for the given client to share between the given authors
* identified by their AuthorIds.
*/
Group createContactGroup(ClientId clientId, int clientVersion,
Group createContactGroup(ClientId clientId, int majorVersion,
AuthorId authorId1, AuthorId authorId2);
}
......@@ -241,7 +241,7 @@ public interface DatabaseComponent {
* <p/>
* Read-only.
*/
Collection<Group> getGroups(Transaction txn, ClientId c, int clientVersion)
Collection<Group> getGroups(Transaction txn, ClientId c, int majorVersion)
throws DbException;
/**
......
......@@ -18,9 +18,9 @@ public interface TransportPropertyManager {
ClientId CLIENT_ID = new ClientId("org.briarproject.bramble.properties");
/**
* The current version of the transport property client.
* The current major version of the transport property client.
*/
int CLIENT_VERSION = 0;
int MAJOR_VERSION = 0;
/**
* Stores the given properties received while adding a contact - they will
......
......@@ -17,22 +17,22 @@ public interface ClientVersioningManager {
ClientId CLIENT_ID = new ClientId("org.briarproject.bramble.versioning");
/**
* The current version of the versioning client.
* The current major version of the versioning client.
*/
int CLIENT_VERSION = 0;
int MAJOR_VERSION = 0;
/**
* Registers a client that will be advertised to contacts. This method
* should be called before {@link LifecycleManager#startServices(String)}.
*/
void registerClient(ClientId clientId, int clientVersion);
void registerClient(ClientId clientId, int majorVersion);
/**
* Registers a hook that will be called when the visibility of the given
* client changes. This method should be called before
* {@link LifecycleManager#startServices(String)}.
*/
void registerClientVersioningHook(ClientId clientId, int clientVersion,
void registerClientVersioningHook(ClientId clientId, int majorVersion,
ClientVersioningHook hook);
/**
......@@ -40,7 +40,7 @@ public interface ClientVersioningManager {
* contact.
*/
Visibility getClientVisibility(Transaction txn, ContactId contactId,
ClientId clientId, int clientVersion) throws DbException;
ClientId clientId, int majorVersion) throws DbException;
interface ClientVersioningHook {
......
......@@ -32,16 +32,16 @@ public class Group {
private final GroupId id;
private final ClientId clientId;
private final int clientVersion;
private final int majorVersion;
private final byte[] descriptor;
public Group(GroupId id, ClientId clientId, int clientVersion,
public Group(GroupId id, ClientId clientId, int majorVersion,
byte[] descriptor) {
if (descriptor.length > MAX_GROUP_DESCRIPTOR_LENGTH)
throw new IllegalArgumentException();
this.id = id;
this.clientId = clientId;
this.clientVersion = clientVersion;
this.majorVersion = majorVersion;
this.descriptor = descriptor;
}
......@@ -60,10 +60,10 @@ public class Group {
}
/**
* Returns the version of the client to which the group belongs.
* Returns the major version of the client to which the group belongs.
*/
public int getClientVersion() {
return clientVersion;
public int getMajorVersion() {
return majorVersion;
}
/**
......
......@@ -6,7 +6,7 @@ import org.briarproject.bramble.api.nullsafety.NotNullByDefault;
public interface GroupFactory {
/**
* Creates a group with the given client ID, client version and descriptor.
* Creates a group with the given client ID, major version and descriptor.
*/
Group createGroup(ClientId c, int clientVersion, byte[] descriptor);
Group createGroup(ClientId c, int majorVersion, byte[] descriptor);
}
......@@ -37,7 +37,7 @@ public interface ValidationManager {
* Registers the message validator for the given client. This method
* should be called before {@link LifecycleManager#startServices(String)}.
*/
void registerMessageValidator(ClientId c, int clientVersion,
void registerMessageValidator(ClientId c, int majorVersion,
MessageValidator v);
/**
......@@ -46,7 +46,7 @@ public interface ValidationManager {
* method should be called before
* {@link LifecycleManager#startServices(String)}.
*/
void registerIncomingMessageHook(ClientId c, int clientVersion,
void registerIncomingMessageHook(ClientId c, int majorVersion,
IncomingMessageHook hook);
interface MessageValidator {
......
......@@ -117,16 +117,16 @@ public class TestUtils {
return new Author(id, FORMAT_VERSION, name, publicKey);
}
public static Group getGroup(ClientId clientId, int clientVersion) {
public static Group getGroup(ClientId clientId, int majorVersion) {
int descriptorLength = 1 + random.nextInt(MAX_GROUP_DESCRIPTOR_LENGTH);
return getGroup(clientId, clientVersion, descriptorLength);
return getGroup(clientId, majorVersion, descriptorLength);
}
public static Group getGroup(ClientId clientId, int clientVersion,
public static Group getGroup(ClientId clientId, int majorVersion,
int descriptorLength) {
GroupId groupId = new GroupId(getRandomId());
byte[] descriptor = getRandomBytes(descriptorLength);
return new Group(groupId, clientId, clientVersion, descriptor);
return new Group(groupId, clientId, majorVersion, descriptor);
}
public static Message getMessage(GroupId groupId) {
......
......@@ -32,25 +32,25 @@ class ContactGroupFactoryImpl implements ContactGroupFactory {
}
@Override
public Group createLocalGroup(ClientId clientId, int clientVersion) {
return groupFactory.createGroup(clientId, clientVersion,
public Group createLocalGroup(ClientId clientId, int majorVersion) {
return groupFactory.createGroup(clientId, majorVersion,
LOCAL_GROUP_DESCRIPTOR);
}
@Override
public Group createContactGroup(ClientId clientId, int clientVersion,
public Group createContactGroup(ClientId clientId, int majorVersion,
Contact contact) {
AuthorId local = contact.getLocalAuthorId();
AuthorId remote = contact.getAuthor().getId();
byte[] descriptor = createGroupDescriptor(local, remote);
return groupFactory.createGroup(clientId, clientVersion, descriptor);
return groupFactory.createGroup(clientId, majorVersion, descriptor);
}
@Override
public Group createContactGroup(ClientId clientId, int clientVersion,
public Group createContactGroup(ClientId clientId, int majorVersion,
AuthorId authorId1, AuthorId authorId2) {
byte[] descriptor = createGroupDescriptor(authorId1, authorId2);
return groupFactory.createGroup(clientId, clientVersion, descriptor);
return groupFactory.createGroup(clientId, majorVersion, descriptor);
}
private byte[] createGroupDescriptor(AuthorId local, AuthorId remote) {
......
......@@ -266,7 +266,7 @@ interface Database<T> {
* <p/>
* Read-only.
*/
Collection<Group> getGroups(T txn, ClientId c, int clientVersion)
Collection<Group> getGroups(T txn, ClientId c, int majorVersion)
throws DbException;
/**
......
......@@ -436,9 +436,9 @@ class DatabaseComponentImpl<T> implements DatabaseComponent {
@Override
public Collection<Group> getGroups(Transaction transaction, ClientId c,
int clientVersion) throws DbException {
int majorVersion) throws DbException {
T txn = unbox(transaction);
return db.getGroups(txn, c, clientVersion);
return db.getGroups(txn, c, majorVersion);
}
@Override
......
......@@ -74,7 +74,7 @@ import static org.briarproject.bramble.db.ExponentialBackoff.calculateExpiry;
abstract class JdbcDatabase implements Database<Connection> {
// Package access for testing
static final int CODE_SCHEMA_VERSION = 37;
static final int CODE_SCHEMA_VERSION = 38;
// Rotation period offsets for incoming transport keys
private static final int OFFSET_PREV = -1;
......@@ -117,7 +117,7 @@ abstract class JdbcDatabase implements Database<Connection> {
"CREATE TABLE groups"
+ " (groupId _HASH NOT NULL,"
+ " clientId _STRING NOT NULL,"
+ " clientVersion INT NOT NULL,"
+ " majorVersion INT NOT NULL,"
+ " descriptor _BINARY NOT NULL,"
+ " PRIMARY KEY (groupId))";
......@@ -276,9 +276,9 @@ abstract class JdbcDatabase implements Database<Connection> {
"CREATE INDEX IF NOT EXISTS contactsByAuthorId"
+ " ON contacts (authorId)";
private static final String INDEX_GROUPS_BY_CLIENT_ID_CLIENT_VERSION =
"CREATE INDEX IF NOT EXISTS groupsByClientIdClientVersion"
+ " ON groups (clientId, clientVersion)";
private static final String INDEX_GROUPS_BY_CLIENT_ID_MAJOR_VERSION =
"CREATE INDEX IF NOT EXISTS groupsByClientIdMajorVersion"
+ " ON groups (clientId, majorVersion)";
private static final String INDEX_MESSAGE_METADATA_BY_GROUP_ID_STATE =
"CREATE INDEX IF NOT EXISTS messageMetadataByGroupIdState"
......@@ -445,7 +445,7 @@ abstract class JdbcDatabase implements Database<Connection> {
try {
s = txn.createStatement();
s.executeUpdate(INDEX_CONTACTS_BY_AUTHOR_ID);
s.executeUpdate(INDEX_GROUPS_BY_CLIENT_ID_CLIENT_VERSION);
s.executeUpdate(INDEX_GROUPS_BY_CLIENT_ID_MAJOR_VERSION);
s.executeUpdate(INDEX_MESSAGE_METADATA_BY_GROUP_ID_STATE);
s.executeUpdate(INDEX_MESSAGE_DEPENDENCIES_BY_DEPENDENCY_ID);
s.executeUpdate(INDEX_STATUSES_BY_CONTACT_ID_GROUP_ID);
......@@ -614,12 +614,12 @@ abstract class JdbcDatabase implements Database<Connection> {
PreparedStatement ps = null;
try {
String sql = "INSERT INTO groups"
+ " (groupId, clientId, clientVersion, descriptor)"
+ " (groupId, clientId, majorVersion, descriptor)"
+ " VALUES (?, ?, ?, ?)";
ps = txn.prepareStatement(sql);
ps.setBytes(1, g.getId().getBytes());
ps.setString(2, g.getClientId().getString());
ps.setInt(3, g.getClientVersion());
ps.setInt(3, g.getMajorVersion());
ps.setBytes(4, g.getDescriptor());
int affected = ps.executeUpdate();
if (affected != 1) throw new DbStateException();
......@@ -1349,18 +1349,18 @@ abstract class JdbcDatabase implements Database<Connection> {
PreparedStatement ps = null;
ResultSet rs = null;
try {
String sql = "SELECT clientId, clientVersion, descriptor"
String sql = "SELECT clientId, majorVersion, descriptor"
+ " FROM groups WHERE groupId = ?";
ps = txn.prepareStatement(sql);
ps.setBytes(1, g.getBytes());
rs = ps.executeQuery();
if (!rs.next()) throw new DbStateException();
ClientId clientId = new ClientId(rs.getString(1));
int clientVersion = rs.getInt(2);
int majorVersion = rs.getInt(2);
byte[] descriptor = rs.getBytes(3);
rs.close();
ps.close();
return new Group(g, clientId, clientVersion, descriptor);
return new Group(g, clientId, majorVersion, descriptor);
} catch (SQLException e) {
tryToClose(rs);
tryToClose(ps);
......@@ -1370,21 +1370,21 @@ abstract class JdbcDatabase implements Database<Connection> {
@Override
public Collection<Group> getGroups(Connection txn, ClientId c,
int clientVersion) throws DbException {
int majorVersion) throws DbException {
PreparedStatement ps = null;
ResultSet rs = null;
try {
String sql = "SELECT groupId, descriptor FROM groups"
+ " WHERE clientId = ? AND clientVersion = ?";
+ " WHERE clientId = ? AND majorVersion = ?";
ps = txn.prepareStatement(sql);
ps.setString(1, c.getString());
ps.setInt(2, clientVersion);
ps.setInt(2, majorVersion);
rs = ps.executeQuery();
List<Group> groups = new ArrayList<>();
while (rs.next()) {
GroupId id = new GroupId(rs.getBytes(1));
byte[] descriptor = rs.getBytes(2);
groups.add(new Group(id, c, clientVersion, descriptor));
groups.add(new Group(id, c, majorVersion, descriptor));
}
rs.close();
ps.close();
......
......@@ -16,7 +16,7 @@ import dagger.Module;
import dagger.Provides;
import static org.briarproject.bramble.api.properties.TransportPropertyManager.CLIENT_ID;
import static org.briarproject.bramble.api.properties.TransportPropertyManager.CLIENT_VERSION;
import static org.briarproject.bramble.api.properties.TransportPropertyManager.MAJOR_VERSION;
@Module
public class PropertiesModule {
......@@ -35,7 +35,7 @@ public class PropertiesModule {
Clock clock) {
TransportPropertyValidator validator = new TransportPropertyValidator(
clientHelper, metadataEncoder, clock);
validationManager.registerMessageValidator(CLIENT_ID, CLIENT_VERSION,
validationManager.registerMessageValidator(CLIENT_ID, MAJOR_VERSION,
validator);
return validator;
}
......@@ -48,12 +48,12 @@ public class PropertiesModule {
ClientVersioningManager clientVersioningManager,
TransportPropertyManagerImpl transportPropertyManager) {
lifecycleManager.registerClient(transportPropertyManager);
validationManager.registerIncomingMessageHook(CLIENT_ID, CLIENT_VERSION,
validationManager.registerIncomingMessageHook(CLIENT_ID, MAJOR_VERSION,
transportPropertyManager);
contactManager.registerContactHook(transportPropertyManager);
clientVersioningManager.registerClient(CLIENT_ID, CLIENT_VERSION);
clientVersioningManager.registerClient(CLIENT_ID, MAJOR_VERSION);
clientVersioningManager.registerClientVersioningHook(CLIENT_ID,
CLIENT_VERSION, transportPropertyManager);
MAJOR_VERSION, transportPropertyManager);
return transportPropertyManager;
}
}
......@@ -69,7 +69,7 @@ class TransportPropertyManagerImpl implements TransportPropertyManager,
this.contactGroupFactory = contactGroupFactory;
this.clock = clock;
localGroup = contactGroupFactory.createLocalGroup(CLIENT_ID,
CLIENT_VERSION);
MAJOR_VERSION);
}
@Override
......@@ -88,7 +88,7 @@ class TransportPropertyManagerImpl implements TransportPropertyManager,
db.addGroup(txn, g);
// Apply the client's visibility to the contact group
Visibility client = clientVersioningManager.getClientVisibility(txn,
c.getId(), CLIENT_ID, CLIENT_VERSION);
c.getId(), CLIENT_ID, MAJOR_VERSION);
if (LOG.isLoggable(INFO))
LOG.info("Applying visibility " + client + " to new contact group");
db.setGroupVisibility(txn, c.getId(), g.getId(), client);
......@@ -313,7 +313,7 @@ class TransportPropertyManagerImpl implements TransportPropertyManager,
private Group getContactGroup(Contact c) {
return contactGroupFactory.createContactGroup(CLIENT_ID,
CLIENT_VERSION, c);
MAJOR_VERSION, c);
}
private void storeMessage(Transaction txn, GroupId g, TransportId t,
......
......@@ -10,11 +10,11 @@ import javax.annotation.concurrent.Immutable;
class ClientVersion implements Comparable<ClientVersion> {
final ClientId clientId;
final int clientVersion;
final int majorVersion;
ClientVersion(ClientId clientId, int clientVersion) {
ClientVersion(ClientId clientId, int majorVersion) {
this.clientId = clientId;
this.clientVersion = clientVersion;
this.majorVersion = majorVersion;
}
@Override
......@@ -22,26 +22,26 @@ class ClientVersion implements Comparable<ClientVersion> {
if (o instanceof ClientVersion) {
ClientVersion cv = (ClientVersion) o;
return clientId.equals(cv.clientId)
&& clientVersion == cv.clientVersion;
&& majorVersion == cv.majorVersion;
}
return false;
}
@Override
public int hashCode() {
return (clientId.hashCode() << 16) + clientVersion;
return (clientId.hashCode() << 16) + majorVersion;
}
@Override
public int compareTo(ClientVersion c) {
int compare = clientId.compareTo(c.clientId);
if (compare != 0) return compare;
return clientVersion - c.clientVersion;
return majorVersion - c.majorVersion;
}
@Override
public String toString() {
return clientId.getString() + ":" + clientVersion;
return clientId.getString() + ":" + majorVersion;
}
}
......@@ -75,23 +75,23 @@ class ClientVersioningManagerImpl implements ClientVersioningManager, Client,
this.contactGroupFactory = contactGroupFactory;
this.clock = clock;
localGroup = contactGroupFactory.createLocalGroup(CLIENT_ID,
CLIENT_VERSION);
MAJOR_VERSION);
}
@Override
public void registerClient(ClientId clientId, int clientVersion) {
clients.add(new ClientVersion(clientId, clientVersion));
public void registerClient(ClientId clientId, int majorVersion) {
clients.add(new ClientVersion(clientId, majorVersion));
}
@Override
public void registerClientVersioningHook(ClientId clientId,
int clientVersion, ClientVersioningHook hook) {
hooks.put(new ClientVersion(clientId, clientVersion), hook);
int majorVersion, ClientVersioningHook hook) {
hooks.put(new ClientVersion(clientId, majorVersion), hook);
}
@Override
public Visibility getClientVisibility(Transaction txn,
ContactId contactId, ClientId clientId, int clientVersion)
ContactId contactId, ClientId clientId, int majorVersion)
throws DbException {
try {
Contact contact = db.getContact(txn, contactId);
......@@ -106,7 +106,7 @@ class ClientVersioningManagerImpl implements ClientVersioningManager, Client,
Update remoteUpdate = loadUpdate(txn, latest.remote.messageId);
Map<ClientVersion, Visibility> visibilities =
getVisibilities(localUpdate.states, remoteUpdate.states);
ClientVersion cv = new ClientVersion(clientId, clientVersion);
ClientVersion cv = new ClientVersion(clientId, majorVersion);
Visibility v = visibilities.get(cv);
return v == null ? INVISIBLE : v;
} catch (FormatException e) {
......@@ -245,7 +245,7 @@ class ClientVersioningManagerImpl implements ClientVersioningManager, Client,
private BdfList encodeClientVersions(List<ClientVersion> versions) {
BdfList encoded = new BdfList();
for (ClientVersion cv : versions)
encoded.add(BdfList.of(cv.clientId.getString(), cv.clientVersion));
encoded.add(BdfList.of(cv.clientId.getString(), cv.majorVersion));
return encoded;
}
......@@ -282,8 +282,8 @@ class ClientVersioningManagerImpl implements ClientVersioningManager, Client,
for (int i = 0; i < size; i++) {
BdfList cv = body.getList(i);
ClientId clientId = new ClientId(cv.getString(0));
int clientVersion = cv.getLong(1).intValue();
parsed.add(new ClientVersion(clientId, clientVersion));
int majorVersion = cv.getLong(1).intValue();
parsed.add(new ClientVersion(clientId, majorVersion));
}
return parsed;
}
......@@ -325,7 +325,7 @@ class ClientVersioningManagerImpl implements ClientVersioningManager, Client,
private Group getContactGroup(Contact c) {
return contactGroupFactory.createContactGroup(CLIENT_ID,
CLIENT_VERSION, c);
MAJOR_VERSION, c);
}
private LatestUpdates findLatestUpdates(Transaction txn, GroupId g)
......@@ -372,11 +372,11 @@ class ClientVersioningManagerImpl implements ClientVersioningManager, Client,
private ClientState parseClientState(BdfList clientState)
throws FormatException {
// Client ID, client version, active
// Client ID, major version, active
ClientId clientId = new ClientId(clientState.getString(0));
int clientVersion = clientState.getLong(1).intValue();
int majorVersion = clientState.getLong(1).intValue();
boolean active = clientState.getBoolean(2);
return new ClientState(clientId, clientVersion, active);
return new ClientState(clientId, majorVersion, active);
}
private long parseUpdateVersion(BdfList body) throws FormatException {
......@@ -420,7 +420,7 @@ class ClientVersioningManagerImpl implements ClientVersioningManager, Client,
private BdfList encodeClientState(ClientState cs) {
return BdfList.of(cs.version.clientId.getString(),
cs.version.clientVersion, cs.active);
cs.version.majorVersion, cs.active);
}
private Map<ClientVersion, Visibility> getVisibilities(
......@@ -536,9 +536,9 @@ class ClientVersioningManagerImpl implements ClientVersioningManager, Client,
this.active = active;
}
private ClientState(ClientId clientId, int clientVersion,
private ClientState(ClientId clientId, int majorVersion,
boolean active) {
this(new ClientVersion(clientId, clientVersion), active);
this(new ClientVersion(clientId, majorVersion), active);
}
@Override
......
......@@ -39,13 +39,13 @@ class ClientVersioningValidator extends BdfMessageValidator {
int size = states.size();
for (int i = 0; i < size; i++) {
BdfList clientState = states.getList(i);
// Client ID, client version, active
// Client ID, major version, active
checkSize(clientState, 3);
String clientId = clientState.getString(0);
checkLength(clientId, 1, MAX_CLIENT_ID_LENGTH);
int clientVersion = clientState.getLong(1).intValue();
if (clientVersion < 0) throw new FormatException();
boolean active = clientState.getBoolean(2);
int majorVersion = clientState.getLong(1).intValue();
if (majorVersion < 0) throw new FormatException();
clientState.getBoolean(2);
}
// Update version
long updateVersion = body.getLong(1);
......
......@@ -28,12 +28,12 @@ class GroupFactoryImpl implements GroupFactory {
}
@Override
public Group createGroup(ClientId c, int clientVersion, byte[] descriptor) {
byte[] clientVersionBytes = new byte[INT_32_BYTES];
ByteUtils.writeUint32(clientVersion, clientVersionBytes, 0);
public Group createGroup(ClientId c, int majorVersion, byte[] descriptor) {
byte[] majorVersionBytes = new byte[INT_32_BYTES];
ByteUtils.writeUint32(majorVersion, majorVersionBytes, 0);
byte[] hash = crypto.hash(LABEL, new byte[] {FORMAT_VERSION},
StringUtils.toUtf8(c.getString()), clientVersionBytes,
StringUtils.toUtf8(c.getString()), majorVersionBytes,
descriptor);
return new Group(new GroupId(hash), c, clientVersion, descriptor);
return new Group(new GroupId(hash), c, majorVersion, descriptor);
}
}
......@@ -28,7 +28,7 @@ import dagger.Module;
import dagger.Provides;
import static org.briarproject.bramble.api.sync.ClientVersioningManager.CLIENT_ID;
import static org.briarproject.bramble.api.sync.ClientVersioningManager.CLIENT_VERSION;
import static org.briarproject.bramble.api.sync.ClientVersioningManager.MAJOR_VERSION;
@Module
public class SyncModule {
......@@ -111,7 +111,7 @@ public class SyncModule {
lifecycleManager.registerClient(clientVersioningManager);
lifecycleManager.registerService(clientVersioningManager);
contactManager.registerContactHook(clientVersioningManager);
validationManager.registerIncomingMessageHook(CLIENT_ID, CLIENT_VERSION,
validationManager.registerIncomingMessageHook(CLIENT_ID, MAJOR_VERSION,
clientVersioningManager);
return clientVersioningManager;
}
......@@ -123,7 +123,7 @@ public class SyncModule {
Clock clock, ValidationManager validationManager) {
ClientVersioningValidator validator = new ClientVersioningValidator(
clientHelper, metadataEncoder, clock);
validationManager.registerMessageValidator(CLIENT_ID, CLIENT_VERSION,
validationManager.registerMessageValidator(CLIENT_ID, MAJOR_VERSION,
validator);
return validator;
}
......
......@@ -81,15 +81,15 @@ class ValidationManagerImpl implements ValidationManager, Service,
}
@Override
public void registerMessageValidator(ClientId c, int clientVersion,
public void registerMessageValidator(ClientId c, int majorVersion,
MessageValidator v) {
validators.put(new ClientVersion(c, clientVersion), v);
validators.put(new ClientVersion(c, majorVersion), v);
}
@Override
public void registerIncomingMessageHook(ClientId c, int clientVersion,
public void registerIncomingMessageHook(ClientId c, int majorVersion,
IncomingMessageHook hook) {
hooks.put(new ClientVersion(c, clientVersion), hook);
hooks.put(new ClientVersion(c, majorVersion), hook);
}
private void validateOutstandingMessagesAsync() {
......@@ -200,11 +200,11 @@ class ValidationManagerImpl implements ValidationManager, Service,
Message m = messageFactory.createMessage(id, raw);
Group g = db.getGroup(txn, m.getGroupId());
ClientId c = g.getClientId();
int clientVersion = g.getClientVersion();
int majorVersion = g.getMajorVersion();
Metadata meta =
db.getMessageMetadataForValidator(txn, id);
DeliveryResult result =
deliverMessage(txn, m, c, clientVersion, meta);
deliverMessage(txn, m, c, majorVersion, meta);
if (result.valid) {
pending.addAll(getPendingDependents(txn, id));
if (result.share) {
......@@ -241,7 +241,7 @@ class ValidationManagerImpl implements ValidationManager, Service,
@ValidationExecutor
private void validateMessage(Message m, Group g) {
ClientVersion cv =
new ClientVersion(g.getClientId(), g.getClientVersion());
new ClientVersion(g.getClientId(), g.getMajorVersion());
MessageValidator v = validators.get(cv);
if (v == null) {
if (LOG.isLoggable(WARNING)) LOG.warning("No validator for " + cv);
......@@ -249,7 +249,7 @@ class ValidationManagerImpl implements ValidationManager, Service,
try {