Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
register: Rename queue_lifespan_secs to idle_queue_timeout.
Prakhar Pratyush3ae84b8a783f
diff --git a/zerver/lib/events.py b/zerver/lib/events.pyindex 1f5446e6e6b..7b8494b672d 100644--- a/zerver/lib/events.py+++ b/zerver/lib/events.py@@ -2076,7 +2076,7 @@ def do_events_register(presence_last_update_id_fetched_by_client: int | None = None,presence_history_limit_days: int | None = None,event_types: Sequence[str] | None = None,- queue_lifespan_secs: int = 0,+ idle_queue_timeout: int = 0,all_public_streams: bool = False,include_subscribers: bool | Literal["partial"] = True,include_streams: bool = True,@@ -2161,7 +2161,7 @@ def do_events_register(apply_markdown,client_gravatar,slim_presence,- queue_lifespan_secs,+ idle_queue_timeout,event_types,all_public_streams,narrow=legacy_narrow,diff --git a/zerver/tornado/django_api.py b/zerver/tornado/django_api.pyindex e904deb2cef..f8168e45a27 100644--- a/zerver/tornado/django_api.py+++ b/zerver/tornado/django_api.py@@ -81,7 +81,7 @@ def request_event_queue(apply_markdown: bool,client_gravatar: bool,slim_presence: bool,- queue_lifespan_secs: int,+ idle_queue_timeout: int,event_types: Sequence[str] | None = None,all_public_streams: bool = False,narrow: Iterable[Sequence[str]] = [],@@ -115,7 +115,7 @@ def request_event_queue("user_client": user_client.name,"narrow": orjson.dumps(narrow),"secret": settings.SHARED_SECRET,- "lifespan_secs": queue_lifespan_secs,+ "idle_queue_timeout": idle_queue_timeout,"bulk_message_deletion": orjson.dumps(bulk_message_deletion),"stream_typing_notifications": orjson.dumps(stream_typing_notifications),"pronouns_field_type_supported": orjson.dumps(pronouns_field_type_supported),diff --git a/zerver/tornado/event_queue.py b/zerver/tornado/event_queue.pyindex 40d9fdf6647..e047979227a 100644--- a/zerver/tornado/event_queue.py+++ b/zerver/tornado/event_queue.py@@ -82,7 +82,7 @@ class ClientDescriptor:client_gravatar: bool,slim_presence: bool,all_public_streams: bool,- lifespan_secs: int,+ idle_queue_timeout: int,narrow: Collection[Sequence[str]],bulk_message_deletion: bool,stream_typing_notifications: bool,@@ -129,11 +129,11 @@ class ClientDescriptor:self.simplified_presence_events = simplified_presence_eventsself.offline = False- # Default for lifespan_secs is DEFAULT_EVENT_QUEUE_TIMEOUT_SECS;+ # Default for idle_queue_timeout is DEFAULT_EVENT_QUEUE_TIMEOUT_SECS;# but users can set it as high as MAX_QUEUE_TIMEOUT_SECS.- if lifespan_secs == 0:- lifespan_secs = DEFAULT_EVENT_QUEUE_TIMEOUT_SECS- self.queue_timeout = min(lifespan_secs, MAX_QUEUE_TIMEOUT_SECS)+ if idle_queue_timeout == 0:+ idle_queue_timeout = DEFAULT_EVENT_QUEUE_TIMEOUT_SECS+ self.queue_timeout = min(idle_queue_timeout, MAX_QUEUE_TIMEOUT_SECS)def to_dict(self) -> dict[str, Any]:# If you add a new key to this dict, make sure you add appropriate@@ -191,7 +191,7 @@ class ClientDescriptor:client_gravatar=d["client_gravatar"],slim_presence=d["slim_presence"],all_public_streams=d["all_public_streams"],- lifespan_secs=d["queue_timeout"],+ idle_queue_timeout=d["queue_timeout"],narrow=d.get("narrow", []),bulk_message_deletion=d.get("bulk_message_deletion", False),stream_typing_notifications=d.get("stream_typing_notifications", False),diff --git a/zerver/tornado/views.py b/zerver/tornado/views.pyindex 0601308195d..9d614bbbf8d 100644--- a/zerver/tornado/views.py+++ b/zerver/tornado/views.py@@ -178,7 +178,7 @@ def get_events_backend(Json[list[list[str]]] | None,ApiParamConfig(documentation_status=DocumentationStatus.INTENTIONALLY_UNDOCUMENTED),] = None,- lifespan_secs: Annotated[+ idle_queue_timeout: Annotated[Json[NonNegativeInt],ApiParamConfig(documentation_status=DocumentationStatus.INTENTIONALLY_UNDOCUMENTED),] = 0,@@ -247,7 +247,7 @@ def get_events_backend(client_gravatar=client_gravatar,slim_presence=slim_presence,all_public_streams=all_public_streams,- queue_timeout=lifespan_secs,+ queue_timeout=idle_queue_timeout,last_connection_time=time.time(),narrow=narrow,bulk_message_deletion=bulk_message_deletion,diff --git a/zerver/views/events_register.py b/zerver/views/events_register.pyindex 366e98cf326..f1d4729a4d9 100644--- a/zerver/views/events_register.py+++ b/zerver/views/events_register.py@@ -50,7 +50,7 @@ def events_register_backend(include_subscribers: Literal["true", "false", "partial"] = "false",narrow: Json[NarrowT] | None = None,presence_history_limit_days: Json[int] | None = None,- queue_lifespan_secs: Annotated[+ idle_queue_timeout: Annotated[Json[int], ApiParamConfig(documentation_status=DocumentationStatus.DOCUMENTATION_PENDING)] = 0,slim_presence: Json[bool] = False,@@ -123,7 +123,7 @@ def events_register_backend(None,presence_history_limit_days,event_types,- queue_lifespan_secs,+ idle_queue_timeout,all_public_streams,narrow=modern_narrow,include_subscribers=parsed_include_subscribers,