mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2025-01-22 10:11:39 +01:00
ensure removing expired members from call is always logged
also return the log item from logger.log so we can ref it
This commit is contained in:
parent
4a36fd96e4
commit
400df6a4ff
@ -30,10 +30,11 @@ export class Logger implements ILogger {
|
||||
this._platform = platform;
|
||||
}
|
||||
|
||||
log(labelOrValues: LabelOrValues, logLevel: LogLevel = LogLevel.Info): void {
|
||||
log(labelOrValues: LabelOrValues, logLevel: LogLevel = LogLevel.Info): ILogItem {
|
||||
const item = new LogItem(labelOrValues, logLevel, this);
|
||||
item.end = item.start;
|
||||
this._persistItem(item, undefined, false);
|
||||
return item;
|
||||
}
|
||||
|
||||
/** Prefer `run()` or `log()` above this method; only use it if you have a long-running operation
|
||||
|
@ -68,7 +68,7 @@ export interface ILogItemCreator {
|
||||
*/
|
||||
|
||||
export interface ILogger {
|
||||
log(labelOrValues: LabelOrValues, logLevel?: LogLevel): void;
|
||||
log(labelOrValues: LabelOrValues, logLevel?: LogLevel): ILogItem;
|
||||
child(labelOrValues: LabelOrValues, logLevel?: LogLevel, filterCreator?: FilterCreator): ILogItem;
|
||||
wrapOrRun<T>(item: ILogItem | undefined, labelOrValues: LabelOrValues, callback: LogCallback<T>, logLevel?: LogLevel, filterCreator?: FilterCreator): T;
|
||||
runDetached<T>(labelOrValues: LabelOrValues, callback: LogCallback<T>, logLevel?: LogLevel, filterCreator?: FilterCreator): ILogItem;
|
||||
|
@ -104,14 +104,17 @@ export class GroupCall extends EventEmitter<{change: never}> {
|
||||
confId: this.id,
|
||||
emitUpdate: member => {
|
||||
const memberKey = getMemberKey(member.userId, member.deviceId);
|
||||
// only remove expired members from the call if we don't have a peer conn with them
|
||||
// only remove expired members to whom we're not already connected
|
||||
if (member.isExpired && !member.isConnected) {
|
||||
const logItem = this.options.logger.log({
|
||||
l: "removing expired member from call",
|
||||
memberKey,
|
||||
callId: this.id
|
||||
})
|
||||
member.logItem?.refDetached(logItem);
|
||||
member.dispose();
|
||||
this._members.remove(memberKey);
|
||||
} else {
|
||||
if (member.isExpired && member.isConnected) {
|
||||
console.trace("was about to kick a connected but expired member");
|
||||
}
|
||||
this._members.update(memberKey, member);
|
||||
}
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user