Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reduce console log spam #3896

Merged
merged 3 commits into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
3 changes: 3 additions & 0 deletions src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1494,6 +1494,9 @@ export class MatrixClient extends TypedEventEmitter<EmittedEvents, ClientEventHa

this.ignoredInvites = new IgnoredInvites(this);
this._secretStorage = new ServerSideSecretStorageImpl(this, opts.cryptoCallbacks ?? {});

// having lots of event listeners is not unusual. 0 means "unlimited".
this.setMaxListeners(0);
}

public set store(newStore: Store) {
Expand Down
3 changes: 1 addition & 2 deletions src/models/read-receipt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,7 @@ export abstract class ReadReceipt<
// was deleted.)
//
// 4. The receipt had the incorrect thread ID (due to a bug in a
// client, or malicious behaviour).
logger.warn(`Ignoring receipt for missing event with id ${receipt.eventId}`);
Copy link
Member

Choose a reason for hiding this comment

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

This only just got added - cc @andybalaam

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes. It's also currently making a test fail, but I'll leave fixing that up until we decide what to do.

EW currently produces a firehose of these warnings, so I'm struggling to believe they are useful.

Copy link
Member

Choose a reason for hiding this comment

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

This usually indicates a bug, unless we got unlucky with a message pointed to by a receipt being deleted.

@florianduros and I have a PR we are hoping to get ready today that fixes 2 bugs that would have caused this message, so please can we tolerate it a little longer until that PR can get merged?

Copy link
Member Author

Choose a reason for hiding this comment

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

Have removed this bit of the PR.

Copy link
Member Author

Choose a reason for hiding this comment

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

this got added back again in #3904

// client, or malicious behaviour).

// This receipt is not "valid" because it doesn't point at an event
// we have. We want to pretend it doesn't exist.
Expand Down
3 changes: 3 additions & 0 deletions src/models/thread.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,9 @@ export class Thread extends ReadReceipt<ThreadEmittedEvents, ThreadEventHandlerM
public constructor(public readonly id: string, public rootEvent: MatrixEvent | undefined, opts: IThreadOpts) {
super();

// each Event in the thread adds a reemitter, so we could hit the listener limit.
this.setMaxListeners(1000);

if (!opts?.room) {
// Logging/debugging for https://github.com/vector-im/element-web/issues/22141
// Hope is that we end up with a more obvious stack trace.
Expand Down
4 changes: 0 additions & 4 deletions src/rust-crypto/rust-crypto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1560,10 +1560,6 @@ class EventDecryptor {
) {}

public async attemptEventDecryption(event: MatrixEvent): Promise<IEventDecryptionResult> {
this.logger.info(
`Attempting decryption of event ${event.getId()} in ${event.getRoomId()} from ${event.getSender()}`,
);

// add the event to the pending list *before* attempting to decrypt.
// then, if the key turns up while decryption is in progress (and
// decryption fails), we will schedule a retry.
Expand Down
1 change: 0 additions & 1 deletion src/webrtc/groupCallEventHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ export class GroupCallEventHandler {
break;
}

logger.debug(`GroupCallEventHandler createGroupCallForRoom() processed room (roomId=${room.roomId})`);
this.getRoomDeferred(room.roomId).resolve!();
}

Expand Down
Loading