streams: Pass only stream IDs for default stream groups data.

Clients do not use default stream groups feature now but they
should only require IDs when they use them and not the full
stream data since that is already available in streams and
subscriptions data.
This commit is contained in:
Sahil Batra
2023-08-03 09:07:14 +05:30
committed by Tim Abbott
parent 1c933dd231
commit 1182e7e350
5 changed files with 13 additions and 105 deletions

View File

@@ -25,6 +25,9 @@ format used by the Zulip server that they are interacting with.
* [`POST /register`](/api/register-queue), [`GET /events`](/api/get-events): * [`POST /register`](/api/register-queue), [`GET /events`](/api/get-events):
Default channels data only includes channel IDs now instead of full Default channels data only includes channel IDs now instead of full
channel data. channel data.
* [`POST /register`](/api/register-queue), [`GET /events`](/api/get-events):
Default channel groups data only includes channel IDs now instead of
full channel data.
**Feature level 329** **Feature level 329**

View File

@@ -34,7 +34,7 @@ DESKTOP_WARNING_VERSION = "5.9.3"
# new level means in api_docs/changelog.md, as well as "**Changes**" # new level means in api_docs/changelog.md, as well as "**Changes**"
# entries in the endpoint's documentation in `zulip.yaml`. # entries in the endpoint's documentation in `zulip.yaml`.
API_FEATURE_LEVEL = 329 # Last bumped for adding field web_suggest_update_timezone API_FEATURE_LEVEL = 330 # Last bumped for updating default streams data.
# Bump the minor PROVISION_VERSION to indicate that folks should provision # 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 # only when going from an old version of the code to a newer version. Bump

View File

@@ -213,7 +213,7 @@ _check_stream_group = DictType(
("name", str), ("name", str),
("id", int), ("id", int),
("description", str), ("description", str),
("streams", ListType(DictType(default_stream_fields))), ("streams", ListType(int)),
] ]
) )

View File

@@ -402,7 +402,7 @@ class DefaultStreamGroup(models.Model):
name=self.name, name=self.name,
id=self.id, id=self.id,
description=self.description, description=self.description,
streams=[stream.to_dict() for stream in self.streams.all().order_by("name")], streams=[stream.id for stream in self.streams.all().order_by("name")],
) )

View File

@@ -2007,63 +2007,7 @@ paths:
"name": "group1", "name": "group1",
"id": 2, "id": 2,
"description": "New description", "description": "New description",
"streams": "streams": [3, 1, 5],
[
{
"name": "Scotland",
"stream_id": 3,
"is_archived": false,
"description": "Located in the United Kingdom",
"rendered_description": "<p>Located in the United Kingdom</p>",
"date_created": 1691057093,
"creator_id": 8,
"invite_only": false,
"is_web_public": false,
"stream_post_policy": 1,
"history_public_to_subscribers": true,
"first_message_id": 1,
"is_recently_active": true,
"message_retention_days": null,
"is_announcement_only": false,
"can_remove_subscribers_group": 2,
},
{
"name": "Denmark",
"stream_id": 1,
"is_archived": false,
"description": "A Scandinavian country",
"rendered_description": "<p>A Scandinavian country</p>",
"date_created": 1691057093,
"creator_id": null,
"invite_only": false,
"is_web_public": false,
"stream_post_policy": 1,
"is_recently_active": true,
"history_public_to_subscribers": true,
"first_message_id": 4,
"message_retention_days": null,
"is_announcement_only": false,
"can_remove_subscribers_group": 2,
},
{
"name": "Verona",
"stream_id": 5,
"is_archived": false,
"description": "A city in Italy",
"rendered_description": "<p>A city in Italy</p>",
"date_created": 1691057093,
"creator_id": 9,
"invite_only": false,
"is_web_public": false,
"stream_post_policy": 1,
"history_public_to_subscribers": true,
"first_message_id": 6,
"is_recently_active": true,
"message_retention_days": null,
"is_announcement_only": false,
"can_remove_subscribers_group": 2,
},
],
}, },
], ],
"id": 0, "id": 0,
@@ -21916,48 +21860,6 @@ components:
- is_announcement_only - is_announcement_only
- can_remove_subscribers_group - can_remove_subscribers_group
- stream_weekly_traffic - stream_weekly_traffic
DefaultChannel:
allOf:
- $ref: "#/components/schemas/BasicChannelBase"
- additionalProperties: false
properties:
stream_id: {}
name: {}
is_archived: {}
description: {}
date_created: {}
creator_id:
nullable: true
invite_only: {}
rendered_description: {}
is_web_public: {}
stream_post_policy: {}
message_retention_days:
nullable: true
history_public_to_subscribers: {}
first_message_id:
nullable: true
is_recently_active: {}
is_announcement_only: {}
can_remove_subscribers_group: {}
can_administer_channel_group: {}
required:
- stream_id
- name
- is_archived
- description
- date_created
- creator_id
- invite_only
- rendered_description
- is_web_public
- stream_post_policy
- message_retention_days
- history_public_to_subscribers
- first_message_id
- is_recently_active
- is_announcement_only
- can_remove_subscribers_group
BasicChannelBase: BasicChannelBase:
type: object type: object
description: | description: |
@@ -23160,10 +23062,13 @@ components:
streams: streams:
type: array type: array
description: | description: |
Array containing details about the channels An array of IDs of all the channels in the default stream group.
in the default channel group.
**Changes**: Before Zulip 10.0 (feature level 330), we sent array
of dictionaries where each dictionary contained details about a
single stream in the default stream group.
items: items:
$ref: "#/components/schemas/DefaultChannel" type: integer
EmailAddressVisibility: EmailAddressVisibility:
type: integer type: integer
description: | description: |