Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

peer_data: Add clear comment about what is stored in stream_subscribers.

Evy Kassirer37815e798899
diff --git a/web/src/peer_data.ts b/web/src/peer_data.ts
index ef7e9ed8cee..bb4fb3a7c9a 100644
--- a/web/src/peer_data.ts
+++ b/web/src/peer_data.ts
@@ -17,6 +17,11 @@ import * as util from "./util.ts";
const subscriber_counts = new Map<number, number>();
// This maps a stream_id to a LazySet of user_ids who are subscribed.
+// We might not have all the subscribers for a given stream. Streams
+// with full data will be stored in `fetched_stream_ids`, and for the
+// rest we try to have all non-long-term-idle subscribers for streams,
+// though that doesn't account for subscribers that become active after
+// pageload.
// Make sure that when we have full subscriber data for a stream,
// the size of its subscribers set stays synced with the relevant
// stream's `subscriber_count`.