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.

events: Remove name field from update subscription events.

sahil8399a432b0c3bbe
diff --git a/frontend_tests/node_tests/lib/events.js b/frontend_tests/node_tests/lib/events.js
index 3c36cea1e03..afd2884164a 100644
--- a/frontend_tests/node_tests/lib/events.js
+++ b/frontend_tests/node_tests/lib/events.js
@@ -562,7 +562,6 @@ exports.fixtures = {
subscription__update: {
type: "subscription",
op: "update",
- name: streams.devel.name,
stream_id: streams.devel.stream_id,
property: "pin_to_top",
value: true,
diff --git a/templates/zerver/api/changelog.md b/templates/zerver/api/changelog.md
index b99efc3fe99..f6ca084132c 100644
--- a/templates/zerver/api/changelog.md
+++ b/templates/zerver/api/changelog.md
@@ -10,6 +10,11 @@ below features are supported.
## Changes in Zulip 4.0
+**Feature level 41**
+
+* [`GET /events`](/api/get-events): Remove name field from update
+ subscription events.
+
**Feature level 40**
* [`GET /events`](/api/get-events): Remove email field from update
diff --git a/version.py b/version.py
index f55e9936c65..3640520e640 100644
--- a/version.py
+++ b/version.py
@@ -30,7 +30,7 @@ DESKTOP_WARNING_VERSION = "5.2.0"
#
# Changes should be accompanied by documentation explaining what the
# new level means in templates/zerver/api/changelog.md.
-API_FEATURE_LEVEL = 40
+API_FEATURE_LEVEL = 41
# Bump the minor PROVISION_VERSION to indicate that folks should provision
# only when going from an old version of the code to a newer version. Bump
diff --git a/zerver/lib/actions.py b/zerver/lib/actions.py
index 54aea2ba07a..d53b9a8389e 100644
--- a/zerver/lib/actions.py
+++ b/zerver/lib/actions.py
@@ -3700,7 +3700,6 @@ def do_change_subscription_property(
property=event_property_name,
value=event_value,
stream_id=stream.id,
- name=stream.name,
)
send_event(user_profile.realm, event, [user_profile.id])
diff --git a/zerver/lib/event_schema.py b/zerver/lib/event_schema.py
index 02e08eb4879..325a0cec30a 100644
--- a/zerver/lib/event_schema.py
+++ b/zerver/lib/event_schema.py
@@ -1225,7 +1225,6 @@ subscription_update_event = event_dict_type(
("property", str),
("stream_id", int),
("value", value_type),
- ("name", str),
]
)
_check_subscription_update = make_checker(subscription_update_event)
diff --git a/zerver/lib/events.py b/zerver/lib/events.py
index 7d89b53426f..c69f1fa9aff 100644
--- a/zerver/lib/events.py
+++ b/zerver/lib/events.py
@@ -783,7 +783,7 @@ def apply_event(
elif event["op"] == "update":
for sub in state["subscriptions"]:
- if sub["name"].lower() == event["name"].lower():
+ if sub["stream_id"] == event["stream_id"]:
sub[event["property"]] = event["value"]
elif event["op"] == "peer_add":
if include_subscribers:
diff --git a/zerver/openapi/zulip.yaml b/zerver/openapi/zulip.yaml
index 42d3f024400..bc406e995f1 100644
--- a/zerver/openapi/zulip.yaml
+++ b/zerver/openapi/zulip.yaml
@@ -580,10 +580,6 @@ paths:
type: integer
description: |
The ID of the stream whose subscription details have changed.
- name:
- type: string
- description: |
- The name of the stream whose subscription details have changed.
property:
type: string
description: |
@@ -609,7 +605,6 @@ paths:
"property": "pin_to_top",
"value": true,
"stream_id": 11,
- "name": "test_stream",
"id": 0,
}
- type: object