Skip to content

Commit

Permalink
fix(logging): Keeps the log storage ready when there is conference er…
Browse files Browse the repository at this point in the history
…ror.

LogCollector stops saving logs the moment we leave the room, although we take care to stop statistics from ljm and throw events so we can flush the logs.
Flush on conference failed.
  • Loading branch information
damencho committed Feb 21, 2025
1 parent ae5fe24 commit e5fa258
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
5 changes: 3 additions & 2 deletions react/features/base/logging/JitsiMeetLogStorage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,10 @@ export default class JitsiMeetLogStorage {
* <tt>false</tt> otherwise.
*/
isReady() {
const { conference } = this.getState()['features/base/conference'];
const { conference, error: conferenceError } = this.getState()['features/base/conference'];
const { error: connectionError } = this.getState()['features/base/connection'];

return Boolean(conference);
return Boolean(conference || conferenceError || connectionError);
}

/**
Expand Down
11 changes: 10 additions & 1 deletion react/features/base/logging/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { AnyAction } from 'redux';

import { IStore } from '../../app/types';
import { APP_WILL_MOUNT } from '../app/actionTypes';
import { CONFERENCE_JOINED } from '../conference/actionTypes';
import { CONFERENCE_FAILED, CONFERENCE_JOINED } from '../conference/actionTypes';
import { getCurrentConference } from '../conference/functions';
import { SET_CONFIG } from '../config/actionTypes';
import JitsiMeetJS, {
Expand Down Expand Up @@ -35,6 +35,15 @@ MiddlewareRegistry.register(store => next => action => {
case CONFERENCE_JOINED:
return _conferenceJoined(store, next, action);

case CONFERENCE_FAILED: {
const result = next(action);
const { logCollector } = store.getState()['features/base/logging'];

logCollector?.flush();

return result;
}

case LIB_WILL_INIT:
return _libWillInit(store, next, action);

Expand Down

0 comments on commit e5fa258

Please sign in to comment.