From e3a809ffd8b658b3ed8221a5120dd015058061b8 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Sun, 31 Dec 2023 13:25:07 +0000 Subject: [PATCH] Replace an assert with sensible handling. It came up the first time I tried to test on a dev instance. --- src/client.rs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/client.rs b/src/client.rs index 6a366c2..da6fdd5 100644 --- a/src/client.rs +++ b/src/client.rs @@ -325,8 +325,15 @@ impl Client { return Ok(false); } } else { - assert!(self.feeds.contains_key(id), - "Shouldn't be extending a feed we've never fetched") + if !self.feeds.contains_key(id) { + // We might be called on to extend a feed that we've + // not yet fetched for the first time, if a streaming + // notification comes in before the user has yet taken + // us into the activity reading that feed. If so, + // ignore the event; the _actual_ initial fetch will + // deal with it later. + return Ok(false); + } } let req = match id { -- 2.30.2