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.

stream_data: Drop the for_tests flag from clear_subscriptions.

Evy Kassirerb452f5b57e3e
diff --git a/web/src/peer_data.ts b/web/src/peer_data.ts
index f69f9e44e2d..e44d070babc 100644
--- a/web/src/peer_data.ts
+++ b/web/src/peer_data.ts
@@ -348,7 +348,7 @@ export function set_subscriber_count(stream_id: number, count: number): void {
subscriber_counts.set(stream_id, count);
}
-export function clear_subscriber_counts_for_tests(): void {
+export function clear_subscriber_counts(): void {
subscriber_counts.clear();
}
diff --git a/web/src/stream_data.ts b/web/src/stream_data.ts
index 659a7dae5e5..dd35da8a83c 100644
--- a/web/src/stream_data.ts
+++ b/web/src/stream_data.ts
@@ -135,7 +135,7 @@ const stream_ids_by_old_names = new FoldDict<number>();
const default_stream_ids = new Set<number>();
const realm_web_public_stream_ids = new Set<number>();
-export function clear_subscriptions(for_tests = true): void {
+export function clear_subscriptions(): void {
// This function is only used once at page load, and then
// it should only be used in tests.
stream_info = new BinaryDict((sub) => sub.subscribed);
@@ -144,12 +144,10 @@ export function clear_subscriptions(for_tests = true): void {
stream_ids_by_old_names.clear();
default_stream_ids.clear();
realm_web_public_stream_ids.clear();
- if (for_tests) {
- peer_data.clear_subscriber_counts_for_tests();
- }
+ peer_data.clear_subscriber_counts();
}
-clear_subscriptions(false);
+clear_subscriptions();
export function rename_sub(sub: StreamSubscription, new_name: string): void {
const old_name = sub.name;