mirror of https://github.com/OpenVidu/openvidu.git
openvidu-server: remove unnecessary try-catch after 2.21 in RpcHandler
parent
993dc831c8
commit
defba84160
|
@ -889,20 +889,18 @@ public class RpcHandler extends DefaultJsonRpcHandler<JsonObject> {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void checkSdkVersionCompliancy(Request<JsonObject> request, Participant participant) {
|
private void checkSdkVersionCompliancy(Request<JsonObject> request, Participant participant) {
|
||||||
// TODO: remove try-catch after release 2.21.0
|
String clientVersion = getStringParam(request, ProtocolElements.JOINROOM_SDKVERSION_PARAM);
|
||||||
String clientVersion = null;
|
|
||||||
try {
|
|
||||||
clientVersion = getStringParam(request, ProtocolElements.JOINROOM_SDKVERSION_PARAM);
|
|
||||||
} catch (RuntimeException e) {
|
|
||||||
// This empty catch is here to support client SDK 2.20.0 with server 2.21.0
|
|
||||||
// TODO: remove try-catch after release 2.21.0
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
final String serverVersion = openviduBuildConfig.getOpenViduServerVersion();
|
final String serverVersion = openviduBuildConfig.getOpenViduServerVersion();
|
||||||
try {
|
try {
|
||||||
new VersionComparator().checkVersionCompatibility(clientVersion, serverVersion);
|
new VersionComparator().checkVersionCompatibility(clientVersion, serverVersion);
|
||||||
} catch (VersionMismatchException e) {
|
} catch (VersionMismatchException e) {
|
||||||
if (e.isIncompatible()) {
|
if (e.isIncompatible()) {
|
||||||
|
|
||||||
|
if (ProtocolElements.RECORDER_PARTICIPANT_PUBLICID.equals(participant.getParticipantPublicId())) {
|
||||||
|
log.error(
|
||||||
|
"The COMPOSED recording layout is using an incompatible version of openvidu-browser SDK ({}) for this OpenVidu deployment ({}). This may cause the system to malfunction",
|
||||||
|
clientVersion, serverVersion);
|
||||||
|
} else {
|
||||||
log.error(
|
log.error(
|
||||||
"Participant {} with IP {} and platform {} has an incompatible version of openvidu-browser SDK ({}) for this OpenVidu deployment ({}). This may cause the system to malfunction",
|
"Participant {} with IP {} and platform {} has an incompatible version of openvidu-browser SDK ({}) for this OpenVidu deployment ({}). This may cause the system to malfunction",
|
||||||
participant.getParticipantPublicId(), participant.getLocation().getIp(),
|
participant.getParticipantPublicId(), participant.getLocation().getIp(),
|
||||||
|
@ -910,8 +908,18 @@ public class RpcHandler extends DefaultJsonRpcHandler<JsonObject> {
|
||||||
log.error(e.getMessage());
|
log.error(e.getMessage());
|
||||||
log.error(
|
log.error(
|
||||||
"openvidu-browser SDK is only compatible with the same version or the immediately following minor version of an OpenVidu deployment");
|
"openvidu-browser SDK is only compatible with the same version or the immediately following minor version of an OpenVidu deployment");
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
DefaultArtifactVersion v = new DefaultArtifactVersion(serverVersion);
|
DefaultArtifactVersion v = new DefaultArtifactVersion(serverVersion);
|
||||||
|
|
||||||
|
if (ProtocolElements.RECORDER_PARTICIPANT_PUBLICID.equals(participant.getParticipantPublicId())) {
|
||||||
|
log.warn(
|
||||||
|
"The COMPOSED recording layout has an older version of openvidu-browser SDK ({}) for this OpenVidu deployment ({}). These versions are still compatible with each other, "
|
||||||
|
+ "but client SDK must be updated as soon as possible to {}.x. This recording layout using openvidu-browser {} will become incompatible with the next release of openvidu-server",
|
||||||
|
clientVersion, serverVersion, (v.getMajorVersion() + "." + v.getMinorVersion()),
|
||||||
|
clientVersion);
|
||||||
|
} else {
|
||||||
log.warn(
|
log.warn(
|
||||||
"Participant {} with IP {} and platform {} has an older version of openvidu-browser SDK ({}) for this OpenVidu deployment ({}). "
|
"Participant {} with IP {} and platform {} has an older version of openvidu-browser SDK ({}) for this OpenVidu deployment ({}). "
|
||||||
+ "These versions are still compatible with each other, but client SDK must be updated as soon as possible to {}.x. This client using "
|
+ "These versions are still compatible with each other, but client SDK must be updated as soon as possible to {}.x. This client using "
|
||||||
|
@ -922,5 +930,6 @@ public class RpcHandler extends DefaultJsonRpcHandler<JsonObject> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue