Skip to content

Commit

Permalink
Send back seednode version in get data response back to client
Browse files Browse the repository at this point in the history
  • Loading branch information
alvasw committed Dec 21, 2024
1 parent bd95df9 commit 5a3d132
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ public final class GetDataResponse extends NetworkEnvelope implements SupportedC
// Added at v1.9.6
private final boolean wasTruncated;

// Added at v1.9.19
private final String version;

public GetDataResponse(@NotNull Set<ProtectedStorageEntry> dataSet,
@NotNull Set<PersistableNetworkPayload> persistableNetworkPayloadSet,
int requestNonce,
Expand All @@ -70,7 +73,8 @@ public GetDataResponse(@NotNull Set<ProtectedStorageEntry> dataSet,
isGetUpdatedDataResponse,
wasTruncated,
Capabilities.app,
Version.getP2PMessageVersion());
Version.getP2PMessageVersion(),
Version.VERSION);
}

///////////////////////////////////////////////////////////////////////////////////////////
Expand All @@ -83,7 +87,8 @@ private GetDataResponse(@NotNull Set<ProtectedStorageEntry> dataSet,
boolean isGetUpdatedDataResponse,
boolean wasTruncated,
@NotNull Capabilities supportedCapabilities,
int messageVersion) {
int messageVersion,
String version) {
super(messageVersion);

this.dataSet = dataSet;
Expand All @@ -92,6 +97,7 @@ private GetDataResponse(@NotNull Set<ProtectedStorageEntry> dataSet,
this.isGetUpdatedDataResponse = isGetUpdatedDataResponse;
this.wasTruncated = wasTruncated;
this.supportedCapabilities = supportedCapabilities;
this.version = version;
}

@Override
Expand All @@ -113,6 +119,7 @@ public protobuf.NetworkEnvelope toProtoNetworkEnvelope() {
.setRequestNonce(requestNonce)
.setIsGetUpdatedDataResponse(isGetUpdatedDataResponse)
.setWasTruncated(wasTruncated)
.setVersion(version)
.addAllSupportedCapabilities(Capabilities.toIntList(supportedCapabilities));

protobuf.NetworkEnvelope proto = getNetworkEnvelopeBuilder()
Expand All @@ -139,7 +146,8 @@ public static GetDataResponse fromProto(protobuf.GetDataResponse proto,
proto.getIsGetUpdatedDataResponse(),
wasTruncated,
Capabilities.fromIntList(proto.getSupportedCapabilitiesList()),
messageVersion);
messageVersion,
proto.getVersion());
}

@Override
Expand Down
1 change: 1 addition & 0 deletions proto/src/main/proto/pb.proto
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ message GetDataResponse {
repeated int32 supported_capabilities = 4;
repeated PersistableNetworkPayload persistable_network_payload_items = 5;
bool was_truncated = 6;
string version = 7;
}

message GetUpdatedDataRequest {
Expand Down

0 comments on commit 5a3d132

Please sign in to comment.