From 4598b1758a7547414bac8cca4d44c005d0c4c01f Mon Sep 17 00:00:00 2001 From: Eric Maciel Date: Thu, 29 Oct 2020 09:29:28 -0400 Subject: [PATCH] fix: garbage cursor error on disconnect --- packages/client/src/withAutomerge.ts | 6 +++++- packages/client/src/withSocketIO.ts | 1 - 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/client/src/withAutomerge.ts b/packages/client/src/withAutomerge.ts index 870c352..26ee14c 100644 --- a/packages/client/src/withAutomerge.ts +++ b/packages/client/src/withAutomerge.ts @@ -62,7 +62,11 @@ const withAutomerge = ( */ e.gabageCursor = () => { - AutomergeEditor.garbageCursor(e, docId) + try { + AutomergeEditor.garbageCursor(e, docId) + } catch (err) { + console.log('garbageCursor error', err) + } } /** diff --git a/packages/client/src/withSocketIO.ts b/packages/client/src/withSocketIO.ts index 62976ba..99b9730 100644 --- a/packages/client/src/withSocketIO.ts +++ b/packages/client/src/withSocketIO.ts @@ -124,7 +124,6 @@ const withSocketIO = ( e.destroy = () => { socket.close() - e.closeConnection() }