Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions .env.template
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
DRIVE_NEW_API_URL=http://drive-server-wip:3004/api
PAYMENTS_API_URL=http://payments-server:8003
MEET_API_URL=http://meet-server:3006
CRYPTO_SECRET=6KYQBP847D4ATSFA
MAGIC_IV=d139cb9a2cd17092e79e1861cf9d7023
MAGIC_SALT=38dce0391b49efba88dbc8c39ebf868f0267eb110bb0012ab27dc52a528d61b1d1ed9d76f400ff58e3240028442b1eab9bb84e111d9dadd997982dbde9dbd25e
JITSI_APP_ID=vpaas-magic-cookie-04a19c25aaab448c9cf74516ffb5ebf2
JITSI_APP_ID=vpaas-magic-cookie-04a19c25aaab448c9cf74516ffb5ebf2
WEBPACK_DEV_SERVER_PROXY_TARGET=https://meet.internxt.com
3 changes: 0 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ jobs:
echo DRIVE_NEW_API_URL="${{ secrets.DRIVE_NEW_API_URL }}" >> .env
echo PAYMENTS_API_URL="${{ secrets.PAYMENTS_API_URL }}" >> .env
echo MEET_API_URL="${{ secrets.MEET_API_URL }}" >> .env
echo CRYPTO_SECRET="${{ secrets.CRYPTO_SECRET }}" >> .env
echo MAGIC_IV="${{ secrets.MAGIC_IV }}" >> .env
echo MAGIC_SALT="${{ secrets.MAGIC_SALT }}" >> .env
echo JITSI_APP_ID="${{ secrets.JITSI_APP_ID }}" >> .env
- name: Build application
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ all.css
.remote-sync.json
.sync-config.cson
.env
.env.*
.npmrc

# Coverage
Expand Down
2 changes: 1 addition & 1 deletion config.js
Original file line number Diff line number Diff line change
Expand Up @@ -789,7 +789,7 @@ var config = {
// enableCalendarIntegration: false,

// Whether to notify when the conference is terminated because it was destroyed.
// notifyOnConferenceDestruction: true,
notifyOnConferenceDestruction: true,

// The client id for the google APIs used for the calendar integration, youtube livestreaming, etc.
// googleApiApplicationClientID: '<client_id>',
Expand Down
6 changes: 2 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"@internxt/css-config": "^1.1.0",
"@internxt/eslint-config-internxt": "^2.0.1",
"@internxt/lib": "^1.4.1",
"@internxt/sdk": "1.15.6",
"@internxt/sdk": "1.15.14",
"@internxt/ui": "0.1.1",
"@jitsi/excalidraw": "https://github.com/jitsi/excalidraw/releases/download/v0.0.19/jitsi-excalidraw-0.0.19.tgz",
"@jitsi/js-utils": "2.6.7",
Expand Down Expand Up @@ -75,7 +75,6 @@
"focus-visible": "5.1.0",
"glob": "11.1.0",
"grapheme-splitter": "1.0.4",
"hash-wasm": "=4.11.0",
"i18n-iso-countries": "6.8.0",
"i18next": "^19.9.2",
"i18next-browser-languagedetector": "^6.1.8",
Expand All @@ -91,7 +90,6 @@
"moment": "2.29.4",
"moment-duration-format": "2.2.2",
"null-loader": "4.0.1",
"openpgp": "^5.11.1",
"optional-require": "1.0.3",
"pixelmatch": "5.3.0",
"promise.withresolvers": "1.0.3",
Expand Down Expand Up @@ -264,7 +262,7 @@
"validate": "npm ls",
"tsc-test:web": "tsc --project tsconfig.web.json --listFilesOnly | grep -v node_modules | grep native",
"tsc-test:native": "tsc --project tsconfig.native.json --listFilesOnly | grep -v node_modules | grep web",
"start": "make dev",
"start": "WEBPACK_DEV_SERVER_PROXY_TARGET=https://meet.internxt.com make dev",
"test": "vitest run",
"test:ui": "vitest --ui",
"test:coverage": "vitest run --coverage",
Expand Down
2 changes: 1 addition & 1 deletion react/features/base/conference/actionTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ export const CONFERENCE_UNIQUE_ID_SET = 'CONFERENCE_UNIQUE_ID_SET';
* }
* }
*/
export const E2E_RTT_CHANGED = 'E2E_RTT_CHANGED'
export const E2E_RTT_CHANGED = 'E2E_RTT_CHANGED';

/**
* The type of (redux) action which signals that a conference will be initialized.
Expand Down
4 changes: 1 addition & 3 deletions react/features/base/conference/middleware.web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,7 @@ MiddlewareRegistry.register(store => next => action => {
Object.values(TRIGGER_READY_TO_CLOSE_REASONS).indexOf(reason)
];
const roomId = room ?? "";
dispatch(hangup(true, roomId, i18next.t(titlekey) || reason));
// new jitsi change, test aht does notifyOnConferenceDestruction
// dispatch(hangup(true, i18next.t(titlekey) || reason, notifyOnConferenceDestruction));
dispatch(hangup(true, roomId, i18next.t(titlekey) || reason, notifyOnConferenceDestruction));
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does notifyOnConferenceDestruction do?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

    // Whether to notify when the conference is terminated because it was destroyed.
    // notifyOnConferenceDestruction: true,

According to Jitsi, it's a question of whether to send a notification or not. I'll activate it just in case. So far, Jitsi's signals are blocked, but maybe it will start working after we permit them

}

releaseScreenLock();
Expand Down
10 changes: 10 additions & 0 deletions react/features/base/connection/actionTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,16 @@ export const CONNECTION_PROPERTIES_UPDATED = 'CONNECTION_PROPERTIES_UPDATED';
*/
export const CONNECTION_WILL_CONNECT = 'CONNECTION_WILL_CONNECT';

/**
* The type of (redux) action which signals that the token for a connection is expired.
*
* {
* type: CONNECTION_TOKEN_EXPIRED,
* connection: JitsiConnection
* }
*/
export const CONNECTION_TOKEN_EXPIRED = 'CONNECTION_TOKEN_EXPIRED';

/**
* The type of (redux) action which sets the location URL of the application,
* connection, conference, etc.
Expand Down
40 changes: 36 additions & 4 deletions react/features/base/connection/actions.any.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,24 @@ import {
} from '../util/uri';

import { setJoinRoomError } from "../meet/general/store/errors/actions";
import { LocalStorageManager } from "../meet/LocalStorageManager";
import MeetingService from "../meet/services/meeting.service";
import { clearNewMeetingFlowSession, isNewMeetingFlow } from "../meet/services/sessionStorage.service";
import { clearNewMeetingFlowSession } from "../meet/services/sessionStorage.service";
import {
CONNECTION_DISCONNECTED,
CONNECTION_ESTABLISHED,
CONNECTION_FAILED,
CONNECTION_PROPERTIES_UPDATED,
CONNECTION_WILL_CONNECT,
CONNECTION_TOKEN_EXPIRED,
SET_LOCATION_URL,
SET_PREFER_VISITOR,
} from "./actionTypes";
import { JITSI_CONNECTION_URL_KEY } from "./constants";
import logger from "./logger";
import { get8x8Options } from "./options8x8";
import { ConnectionFailedError, IIceServers } from "./types";
import { ConfigService } from '../meet/services/config.service';
import { SessionStorageManager } from '../meet/SessionStorageManager';

/**
* The options that will be passed to the JitsiConnection instance.
Expand Down Expand Up @@ -155,7 +157,9 @@ export function constructOptions(state: IReduxState) {
options.websocketKeepAliveUrl = appendURLParam(options.websocketKeepAliveUrl, "room", roomName ?? "");
}
if (options.conferenceRequestUrl) {
options.conferenceRequestUrl = appendURLParam(options.conferenceRequestUrl, "room", roomName ?? "");
options.conferenceRequestUrl = ConfigService.instance.isDevelopment()
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

perfect :)

? undefined
: appendURLParam(options.conferenceRequestUrl, "room", roomName ?? "");
}
}

Expand Down Expand Up @@ -242,7 +246,7 @@ export function _connectInternal({
let userUUID: string | undefined;

if (isAnonymous) {
userUUID = LocalStorageManager.instance.getOrCreateAnonymousUUID();
userUUID = SessionStorageManager.instance.getOrCreateAnonymousUUID();
}
const { token: jwt, appId } = await MeetingService.instance.joinCall(room, {
name: displayName ?? name ?? "",
Expand All @@ -268,6 +272,7 @@ export function _connectInternal({
connection.addEventListener(JitsiConnectionEvents.CONNECTION_FAILED, _onConnectionFailed);
connection.addEventListener(JitsiConnectionEvents.CONNECTION_REDIRECTED, _onConnectionRedirected);
connection.addEventListener(JitsiConnectionEvents.PROPERTIES_UPDATED, _onPropertiesUpdate);
connection.addEventListener(JitsiConnectionEvents.CONNECTION_TOKEN_EXPIRED, _onTokenExpired);

/**
* Unsubscribe the connection instance from
Expand Down Expand Up @@ -362,6 +367,16 @@ export function _connectInternal({
dispatch(redirect(vnode, focusJid, username));
}

/**
* Connection will resume.
*
* @private
* @returns {void}
*/
function _onTokenExpired(): void {
dispatch(_connectionTokenExpired(connection));
}

/**
* Connection properties were updated.
*
Expand Down Expand Up @@ -416,6 +431,23 @@ export function _connectInternal({
function _connectionWillConnect(connection: Object) {
return {
type: CONNECTION_WILL_CONNECT,
connection,
};
}

/**
* Create an action for when a connection token is expired.
*
* @param {JitsiConnection} connection - The {@code JitsiConnection} token is expired.
* @private
* @returns {{
* type: CONNECTION_TOKEN_EXPIRED,
* connection: JitsiConnection
* }}
*/
function _connectionTokenExpired(connection: Object) {
return {
type: CONNECTION_TOKEN_EXPIRED,
connection
};
}
Expand Down
40 changes: 19 additions & 21 deletions react/features/base/connection/actions.web.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,21 @@ import { LocalStorageManager } from "../meet/LocalStorageManager";
import MeetingService from "../meet/services/meeting.service";
import { _connectInternal } from "./actions.any";
import logger from './logger';
import { SessionStorageManager } from '../meet/SessionStorageManager';

/**
* Helper function to leave a call with proper user identification (authenticated or anonymous)
* If authenticated user - uuid is taken from the token, else - sent anonymous uuid from local storage
* @param {string} roomId - The room ID to leave
* @returns {Promise<void>}
*/
async function leaveCallWithUserIdentification(roomId: string): Promise<void> {
export async function leaveCallWithUserIdentification(roomId: string): Promise<void> {
const user = LocalStorageManager.instance.getUser();
const anonymousUserId = user ? undefined : LocalStorageManager.instance.getAnonymousUUID();
return await MeetingService.instance.leaveCall(roomId, anonymousUserId ? { userId: anonymousUserId } : undefined);
let payload = undefined;
if (!user){
payload = { userId: SessionStorageManager.instance.getAnonymousUUID() || '' };
}
return await MeetingService.instance.leaveCall(roomId, payload);
}

export * from "./actions.any";
Expand All @@ -40,35 +45,29 @@ export function connect(id?: string, password?: string) {
const state = getState();
const { jwt } = state["features/base/jwt"];
const { iAmRecorder, iAmSipGateway } = state["features/base/config"];
// TODO: CHECK WHY USER REDUCER IS NULL IN THIS POINT, initializers are not executing as expected
// const { user } = state["features/user"];

const user = LocalStorageManager.instance.getUser();

if (!iAmRecorder && !iAmSipGateway && isVpaasMeeting(state)) {
return dispatch(getCustomerDetails())
.then(() => {
if (!jwt) {
return getJaasJWT(state);
}
})
.then((j) => j && dispatch(setJWT(j)))
.then(() =>
dispatch(
.then(j => {
j && dispatch(setJWT(j));

return dispatch(
_connectInternal({
id,
password,
name: user?.name,
lastname: user?.lastname,
isAnonymous: !user,
})
)
)
// latest jitsi changes, test if not works current ones
// .then(j => {
// j && dispatch(setJWT(j));

// return dispatch(_connectInternal(id, password));
// })
.catch(e => {
);
}).catch(e => {
logger.error('Connection error', e);
});
}
Expand Down Expand Up @@ -139,14 +138,13 @@ export function hangup(requestFeedback = false, roomId?: string, feedbackTitle?:

export async function cleanupAndReload(roomId: string) {
try{
console.log('[RELOAD_PAGE]: Leaving the call');
console.log('[RELOAD] cleanupAndReload is called:', roomId);
await leaveCallWithUserIdentification(roomId);
console.log('[RELOAD_PAGE]: Cleaning up the conference');
await APP.conference.cleanup();
} catch (error) {
console.error("[RELOAD_PAGE]: Error during cleanup and reload", error);
console.error("[RELOAD]: Error during cleanup and reload", error);
} finally {
console.log("[RELOAD_PAGE]: Reloading the page");
console.log("[RELOAD]: Reloading the page");
window.location.reload();
}
}
43 changes: 14 additions & 29 deletions react/features/base/connection/middleware.web.ts
Original file line number Diff line number Diff line change
@@ -1,45 +1,30 @@
import { redirectToStaticPage } from '../../app/actions.any';
import { CONFERENCE_WILL_LEAVE } from "../conference/actionTypes";
import { isLeavingConferenceManually, setLeaveConferenceManually } from "../meet/general/utils/conferenceState";
import MiddlewareRegistry from "../redux/MiddlewareRegistry";
import MiddlewareRegistry from '../redux/MiddlewareRegistry';

import { CONNECTION_DISCONNECTED, CONNECTION_WILL_CONNECT } from "./actionTypes";
import { CONNECTION_WILL_CONNECT } from './actionTypes';

/**
* The feature announced so we can distinguish jibri participants.
*
* @type {string}
*/
export const DISCO_JIBRI_FEATURE = "http://jitsi.org/protocol/jibri";
export const DISCO_JIBRI_FEATURE = 'http://jitsi.org/protocol/jibri';

MiddlewareRegistry.register(({ getState, dispatch }) => (next) => (action) => {
MiddlewareRegistry.register(({ getState }) => next => action => {
switch (action.type) {
case CONNECTION_WILL_CONNECT: {
const { connection } = action;
const { iAmRecorder } = getState()["features/base/config"];
case CONNECTION_WILL_CONNECT: {
const { connection } = action;
const { iAmRecorder } = getState()['features/base/config'];

if (iAmRecorder) {
connection.addFeature(DISCO_JIBRI_FEATURE);
}

// @ts-ignore
APP.connection = connection;

setLeaveConferenceManually(false);
break;
}

case CONFERENCE_WILL_LEAVE: {
setLeaveConferenceManually(true);
break;
if (iAmRecorder) {
connection.addFeature(DISCO_JIBRI_FEATURE);
}

case CONNECTION_DISCONNECTED: {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this no longer necessary?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

setLeaveConferenceManually(false);
// @ts-ignore
APP.connection = connection;

break;
}
break;
}
}

return next(action);
});
});
Loading
Loading