Skip to content

Commit

Permalink
fix: Jitsi call can't be launched when room name is too long - EXO-71657
Browse files Browse the repository at this point in the history


Before this fix, when we call codec.encode(callId), the sub class use org.gatein.common.util.Base64 to encode callId. A base64 have a length limit, and this function add '\n' char when the limit it reach to separate lines.
The java.util.Base64 does not recognise this character and throw an error.

First option was to simply remove the \n in inviteId after encode, but the invite id generated is larger than 32char, the limit of the field in database
As it is not necessary to have long inviteId value, and as the risk of collide is very low with the first 32 chars, this fix limit the length of the invite. With that, the \n char is certainly removed (as it occurs after the 32nd char), AND the inviteId is not too long for the column in database.
  • Loading branch information
rdenarie committed May 16, 2024
1 parent a9b40a2 commit e3d29b5
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2859,6 +2859,7 @@ private void createInvite(String callId, String identity, String type, String in
*/
private String createInvite(String callId) {
String inviteId = codec.encode(callId);
inviteId = inviteId.substring(0,32);
byte[] inviteIdBytes = Base64.getDecoder().decode(inviteId);
inviteId = Base64.getUrlEncoder().withoutPadding().encodeToString(inviteIdBytes);

Expand Down

0 comments on commit e3d29b5

Please sign in to comment.