* Calls: Add backend version check to enable DC locking * Update calls-common
This commit is contained in:
parent
a255fef9ba
commit
b2e1b5f467
7 changed files with 32 additions and 19 deletions
|
|
@ -1,8 +1,8 @@
|
|||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
||||
// See LICENSE.txt for license information.
|
||||
|
||||
import type {ApiResp, CallsVersion} from '@calls/types/calls';
|
||||
import type {CallChannelState, CallJobState, CallsConfig} from '@mattermost/calls/lib/types';
|
||||
import type {ApiResp} from '@calls/types/calls';
|
||||
import type {CallChannelState, CallJobState, CallsConfig, CallsVersionInfo} from '@mattermost/calls/lib/types';
|
||||
import type {RTCIceServer} from 'react-native-webrtc';
|
||||
|
||||
export interface ClientCallsMix {
|
||||
|
|
@ -10,7 +10,7 @@ export interface ClientCallsMix {
|
|||
getCalls: (groupLabel?: RequestGroupLabel) => Promise<CallChannelState[]>;
|
||||
getCallForChannel: (channelId: string) => Promise<CallChannelState>;
|
||||
getCallsConfig: (groupLabel?: RequestGroupLabel) => Promise<CallsConfig>;
|
||||
getVersion: (groupLabel?: RequestGroupLabel) => Promise<CallsVersion>;
|
||||
getVersion: (groupLabel?: RequestGroupLabel) => Promise<CallsVersionInfo>;
|
||||
enableChannelCalls: (channelId: string, enable: boolean) => Promise<CallChannelState>;
|
||||
endCall: (channelId: string) => Promise<ApiResp>;
|
||||
genTURNCredentials: () => Promise<RTCIceServer[]>;
|
||||
|
|
|
|||
|
|
@ -44,6 +44,9 @@ describe('newConnection', () => {
|
|||
AllowEnableCalls: true,
|
||||
EnableAV1: true,
|
||||
})),
|
||||
getVersion: jest.fn(() => ({
|
||||
version: '1.7.0',
|
||||
})),
|
||||
genTURNCredentials: jest.fn(() => Promise.resolve([{
|
||||
urls: ['turn:turn.example.com'],
|
||||
username: 'user',
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
// See LICENSE.txt for license information.
|
||||
|
||||
import {RTCMonitor, RTCPeer, parseRTCStats} from '@mattermost/calls/lib';
|
||||
import {hasDCSignalingLockSupport} from '@mattermost/calls/lib/utils';
|
||||
import {zlibSync, strToU8} from 'fflate';
|
||||
import {DeviceEventEmitter, type EmitterSubscription, NativeEventEmitter, NativeModules, Platform} from 'react-native';
|
||||
import InCallManager from 'react-native-incall-manager';
|
||||
|
|
@ -88,10 +89,11 @@ export async function newConnection(
|
|||
const credentials = await getServerCredentials(serverUrl);
|
||||
|
||||
let config;
|
||||
let version;
|
||||
try {
|
||||
config = await client.getCallsConfig();
|
||||
[config, version] = await Promise.all([client.getCallsConfig(), client.getVersion()]);
|
||||
} catch (err) {
|
||||
throw new Error(`calls: fetching calls config: ${getFullErrorMessage(err)}`);
|
||||
throw new Error(`calls: fetching calls config and version info: ${getFullErrorMessage(err)}`);
|
||||
}
|
||||
|
||||
let av1Support = false;
|
||||
|
|
@ -387,6 +389,7 @@ export async function newConnection(
|
|||
iceServers: iceConfigs || [],
|
||||
logger,
|
||||
dcSignaling: config.EnableDCSignaling,
|
||||
dcLocking: hasDCSignalingLockSupport(version),
|
||||
});
|
||||
|
||||
collectICEStats();
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import {
|
|||
type CallsConfig,
|
||||
type EmojiData,
|
||||
type UserReactionData,
|
||||
type CallsVersionInfo,
|
||||
} from '@mattermost/calls/lib/types';
|
||||
|
||||
import type UserModel from '@typings/database/models/servers/user';
|
||||
|
|
@ -153,7 +154,7 @@ export type CallsConfigState = CallsConfig & {
|
|||
AllowEnableCalls: boolean;
|
||||
GroupCallsAllowed: boolean;
|
||||
pluginEnabled: boolean;
|
||||
version: CallsVersion;
|
||||
version: CallsVersionInfo;
|
||||
last_retrieved_at: number;
|
||||
}
|
||||
|
||||
|
|
@ -211,11 +212,6 @@ export type AudioDeviceInfo = {
|
|||
selectedAudioDevice: AudioDevice;
|
||||
};
|
||||
|
||||
export type CallsVersion = {
|
||||
version?: string;
|
||||
build?: string;
|
||||
};
|
||||
|
||||
export type LiveCaptionMobile = {
|
||||
captionId: string;
|
||||
sessionId: string;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
// See LICENSE.txt for license information.
|
||||
|
||||
import {makeCallsBaseAndBadgeRGB, rgbToCSS} from '@mattermost/calls';
|
||||
import {type CallsConfig, type CallPostProps, isCaption, type Caption, isCallJobMetadata, type CallJobMetadata} from '@mattermost/calls/lib/types';
|
||||
import {type CallsConfig, type CallPostProps, isCaption, type Caption, isCallJobMetadata, type CallJobMetadata, type CallsVersionInfo} from '@mattermost/calls/lib/types';
|
||||
import {Alert} from 'react-native';
|
||||
import {SelectedTrackType, TextTrackType, type ISO639_1, type SelectedTrack, type TextTracks} from 'react-native-video';
|
||||
|
||||
|
|
@ -17,7 +17,6 @@ import type {
|
|||
CallsConfigState,
|
||||
CallSession,
|
||||
CallsTheme,
|
||||
CallsVersion,
|
||||
} from '@calls/types/calls';
|
||||
import type PostModel from '@typings/database/models/servers/post';
|
||||
import type UserModel from '@typings/database/models/servers/user';
|
||||
|
|
@ -96,7 +95,7 @@ export function isSupportedServerCalls(serverVersion?: string) {
|
|||
return false;
|
||||
}
|
||||
|
||||
export function isMultiSessionSupported(callsVersion: CallsVersion) {
|
||||
export function isMultiSessionSupported(callsVersion: CallsVersionInfo) {
|
||||
return isMinimumServerVersion(
|
||||
callsVersion.version,
|
||||
Calls.MultiSessionCallsVersion.MAJOR_VERSION,
|
||||
|
|
|
|||
20
package-lock.json
generated
20
package-lock.json
generated
|
|
@ -17,7 +17,7 @@
|
|||
"@formatjs/intl-numberformat": "8.15.1",
|
||||
"@formatjs/intl-pluralrules": "5.4.1",
|
||||
"@gorhom/bottom-sheet": "5.0.6",
|
||||
"@mattermost/calls": "github:mattermost/calls-common#fe9b2e74328facc46c2d9e3729ec3a9704d7c618",
|
||||
"@mattermost/calls": "github:mattermost/calls-common#02b04117fcec88f158d3d9ba62546d8d942ed647",
|
||||
"@mattermost/compass-icons": "0.1.48",
|
||||
"@mattermost/hardware-keyboard": "file:./libraries/@mattermost/hardware-keyboard",
|
||||
"@mattermost/react-native-emm": "1.6.1",
|
||||
|
|
@ -4596,11 +4596,12 @@
|
|||
"node_modules/@mattermost/calls": {
|
||||
"name": "@mattermost/calls-common",
|
||||
"version": "0.27.2",
|
||||
"resolved": "git+ssh://git@github.com/mattermost/calls-common.git#fe9b2e74328facc46c2d9e3729ec3a9704d7c618",
|
||||
"integrity": "sha512-Wj2fclEcPVWYtX7WdrMOaLHXS2AP3y2x8Py9FqHyhoNNY9yUg+ihocUKDKpRwqfu1qM/R02Y26d/g6Mc4+yddg==",
|
||||
"resolved": "git+ssh://git@github.com/mattermost/calls-common.git#02b04117fcec88f158d3d9ba62546d8d942ed647",
|
||||
"integrity": "sha512-jHlw8b8k0LrOyAzh/6cSnTg3GHL3yJEZhtNhjvvfEnmxso2CzproEX7juzATtMy0Z1NXOLgdBrn/M0naPxJqgA==",
|
||||
"dependencies": {
|
||||
"@msgpack/msgpack": "3.0.0-beta2",
|
||||
"fflate": "0.8.2"
|
||||
"fflate": "0.8.2",
|
||||
"semver": "7.7.1"
|
||||
}
|
||||
},
|
||||
"node_modules/@mattermost/calls/node_modules/@msgpack/msgpack": {
|
||||
|
|
@ -4610,6 +4611,17 @@
|
|||
"node": ">= 14"
|
||||
}
|
||||
},
|
||||
"node_modules/@mattermost/calls/node_modules/semver": {
|
||||
"version": "7.7.1",
|
||||
"resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz",
|
||||
"integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==",
|
||||
"bin": {
|
||||
"semver": "bin/semver.js"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=10"
|
||||
}
|
||||
},
|
||||
"node_modules/@mattermost/commonmark": {
|
||||
"version": "0.30.1-2",
|
||||
"license": "BSD-2-Clause",
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@
|
|||
"@formatjs/intl-numberformat": "8.15.1",
|
||||
"@formatjs/intl-pluralrules": "5.4.1",
|
||||
"@gorhom/bottom-sheet": "5.0.6",
|
||||
"@mattermost/calls": "github:mattermost/calls-common#fe9b2e74328facc46c2d9e3729ec3a9704d7c618",
|
||||
"@mattermost/calls": "github:mattermost/calls-common#02b04117fcec88f158d3d9ba62546d8d942ed647",
|
||||
"@mattermost/compass-icons": "0.1.48",
|
||||
"@mattermost/hardware-keyboard": "file:./libraries/@mattermost/hardware-keyboard",
|
||||
"@mattermost/react-native-emm": "1.6.1",
|
||||
|
|
|
|||
Loading…
Reference in a new issue