From 3e44d7307fcb00a66bf2f4cb0f4e2e29c5e51078 Mon Sep 17 00:00:00 2001 From: Richard van der Hoff Date: Thu, 16 Jun 2016 08:06:12 +0100 Subject: [PATCH] Fix eventListener warning Bump up maxEventListeners on the MatrixClient to shut up the warning about leaks. --- src/MatrixClientPeg.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/MatrixClientPeg.js b/src/MatrixClientPeg.js index cc96503316..143b804228 100644 --- a/src/MatrixClientPeg.js +++ b/src/MatrixClientPeg.js @@ -50,6 +50,11 @@ function createClientForPeg(hs_url, is_url, user_id, access_token, guestAccess) } matrixClient = Matrix.createClient(opts); + + // we're going to add eventlisteners for each matrix event tile, so the + // potential number of event listeners is quite high. + matrixClient.setMaxListeners(500); + if (guestAccess) { console.log("Guest: %s", guestAccess.isGuest()); matrixClient.setGuest(guestAccess.isGuest()); @@ -91,7 +96,7 @@ class MatrixClient { } // FIXME, XXX: this all seems very convoluted :( - // + // // if we replace the singleton using URLs we bypass our createClientForPeg() // global helper function... but if we replace it using // an access_token we don't?