From 955a77e5e8f310cd8890b43d97526a8c9f7cbeba Mon Sep 17 00:00:00 2001 From: Daniel Lugo Date: Thu, 13 Feb 2020 14:31:00 -0400 Subject: [PATCH] signal remote disconnect --- services/gunDB/contact-api/streams/pubToFeed.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/services/gunDB/contact-api/streams/pubToFeed.js b/services/gunDB/contact-api/streams/pubToFeed.js index f94d8caf..ca6ae0fa 100644 --- a/services/gunDB/contact-api/streams/pubToFeed.js +++ b/services/gunDB/contact-api/streams/pubToFeed.js @@ -83,6 +83,13 @@ const onOpenForPubFeedPair = ([pub, feed]) => `onOpenForPubFeedPair -> didDisconnect -> pub: ${pub} - feed: ${feed}` ) }) + // signal disconnect to listeners listeners should rely on pubToFeed for + // disconnect status instead of pub-to-incoming. Only the latter will + // detect remote disconnection + setPubToFeed({ + ...getPubToFeed(), + [pub]: null + }) return }