You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-26 17:03:12 +03:00
Clean up/improve e2e logging
In an attempt to make the rageshake logs a bit more useful, try to make the logging a bit saner. Firstly, make sure we log every decryption failure, and log it exactly once, rather than in several places. Also record when we receive megolm keys. Also add some more explicit logging in the sync loop.
This commit is contained in:
12
src/sync.js
12
src/sync.js
@@ -360,9 +360,6 @@ SyncApi.prototype.getSyncState = function() {
|
||||
* Main entry point
|
||||
*/
|
||||
SyncApi.prototype.sync = function() {
|
||||
debuglog("SyncApi.sync: starting with sync token " +
|
||||
this.client.store.getSyncToken());
|
||||
|
||||
const client = this.client;
|
||||
const self = this;
|
||||
|
||||
@@ -511,11 +508,14 @@ SyncApi.prototype._sync = function(syncOptions) {
|
||||
// normal timeout= plus buffer time
|
||||
const clientSideTimeoutMs = this.opts.pollTimeout + BUFFER_PERIOD_MS;
|
||||
|
||||
debuglog('Starting sync since=' + syncToken);
|
||||
this._currentSyncRequest = client._http.authedRequest(
|
||||
undefined, "GET", "/sync", qps, undefined, clientSideTimeoutMs,
|
||||
);
|
||||
|
||||
this._currentSyncRequest.done(function(data) {
|
||||
debuglog('Completed sync, next_batch=' + data.next_batch);
|
||||
|
||||
// set the sync token NOW *before* processing the events. We do this so
|
||||
// if something barfs on an event we can skip it rather than constantly
|
||||
// polling with the same token.
|
||||
@@ -666,8 +666,10 @@ SyncApi.prototype._processSyncResponse = function(syncToken, data) {
|
||||
toDeviceEvent.getType() == "m.room.message" &&
|
||||
content.msgtype == "m.bad.encrypted"
|
||||
) {
|
||||
console.warn(
|
||||
"Unable to decrypt to-device event: " + content.body,
|
||||
// the mapper already logged a warning.
|
||||
console.log(
|
||||
'Ignoring undecryptable to-device event from ' +
|
||||
toDeviceEvent.getSender(),
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user