zulip/zerver/views
Lauryn Menard 31daef7f79 response: Remove "result: partially_completed" for success responses.
In feature levels 153 and 154, a new value of "partially_completed"
for `result` in a success (HTTP status code 200) was added for two
endpoints that process messages in batches: /api/delete-topic and
/api/mark-all-as-read.

Prior to these changes, `result` was either "success" or "error" for
all responses, which was a useful API invariant to have for clients.

So, here we remove "partially_completed" as a potential value for
"result" in a response. And instead, for the two endpoints noted
above, we return a boolean field "complete" to indicate if the
response successfully deleted/marked as read all the targeted
messages (complete: true) or if only some of the targeted messages
were processed (complete: false).

The "code" field for an error string that was also returned as part
of a partially completed response is removed in these changes as
well.

The web app does not currently use the /api/mark-all-as-read
endpoint, but it does use the /api/delete-topic endpoint, so these
changes update that to check the `complete` boolean instead of the
string value for `result`.
2023-09-18 13:18:24 -07:00
..
development python: Elide unnecessary list wrappers. 2023-09-13 12:41:23 -07:00
__init__.py
alert_words.py alert_words: Migrate alert_words to use @typed_endpoint. 2023-09-08 08:20:17 -07:00
attachments.py actions: Split out zerver.actions.uploads. 2022-04-14 17:14:32 -07:00
auth.py python: Annotate type aliases with TypeAlias. 2023-08-07 10:02:49 -07:00
compatibility.py django: Use HttpRequest.headers. 2022-05-13 20:42:20 -07:00
custom_profile_fields.py ruff: Fix PLR1714 Consider merging multiple comparisons. 2023-07-23 15:21:33 -07:00
digest.py mypy: Fix most AnonymousUser type errors. 2021-07-24 14:55:46 -07:00
documentation.py python: Elide unnecessary list wrappers. 2023-09-13 12:41:23 -07:00
drafts.py drafts: Migrate drafts to use @typed_endpoint. 2023-09-08 08:20:17 -07:00
email_mirror.py backend: Add request as parameter to json_success. 2022-02-04 15:16:56 -08:00
events_register.py python: Annotate type aliases with TypeAlias. 2023-08-07 10:02:49 -07:00
home.py narrow: Split out narrow_helpers. 2023-06-30 11:26:23 -07:00
hotspots.py python: Convert translated positional {} fields to {named} fields. 2023-07-18 15:19:07 -07:00
invite.py invites: Make it possible for non-admins to revoke multiuse invites. 2023-09-07 14:21:01 -07:00
message_edit.py message_edit: Migrate message_edit to use @typed_endpoint. 2023-09-08 08:20:17 -07:00
message_fetch.py Revert "narrow: Fix topic highlighting issue with apostrophes in search results." 2023-08-15 17:51:03 -07:00
message_flags.py response: Remove "result: partially_completed" for success responses. 2023-09-18 13:18:24 -07:00
message_send.py ruff: Collapse short multi-line import statements. 2023-08-02 17:41:41 -07:00
muted_users.py muted users: Add support to muting bots. 2023-06-13 16:44:12 -07:00
presence.py presence: Migrate presence to use @typed_endpoint. 2023-09-08 08:20:17 -07:00
push_notifications.py backend: Add request as parameter to json_success. 2022-02-04 15:16:56 -08:00
reactions.py message: Access realm object directly from message. 2023-08-23 11:38:32 -07:00
read_receipts.py read_receipts: Exclude muted users from read receipts. 2022-09-16 16:19:54 -07:00
realm.py inbox: Add inbox as default view. 2023-09-18 12:17:49 -07:00
realm_domains.py python: Convert translated positional {} fields to {named} fields. 2023-07-18 15:19:07 -07:00
realm_emoji.py ruff: Fix RUF015 Prefer `next(...)` over single element slice. 2023-07-23 15:20:53 -07:00
realm_export.py migration: Rename extra_data_json to extra_data in audit log models. 2023-08-16 17:18:14 -07:00
realm_icon.py ruff: Fix RUF015 Prefer `next(...)` over single element slice. 2023-07-23 15:20:53 -07:00
realm_linkifiers.py linkifier: Support reordering linkifiers. 2023-08-14 15:21:48 -07:00
realm_logo.py ruff: Fix RUF015 Prefer `next(...)` over single element slice. 2023-07-23 15:20:53 -07:00
realm_playgrounds.py realm_playgrounds: Refactor error handling for validation on creation. 2023-07-24 17:40:59 -07:00
registration.py python: Delete superfluous parens. 2023-09-13 13:40:19 -07:00
report.py ruff: Collapse short multi-line import statements. 2023-08-02 17:41:41 -07:00
scheduled_messages.py scheduled-messages: Update scheduled_message_id parameter for DELETE. 2023-05-31 08:15:03 -07:00
sentry.py python: Delete superfluous parens. 2023-09-13 13:40:19 -07:00
storage.py backend: Add request as parameter to json_success. 2022-02-04 15:16:56 -08:00
streams.py response: Remove "result: partially_completed" for success responses. 2023-09-18 13:18:24 -07:00
submessage.py actions: Split out zerver.actions.submessage. 2022-04-14 17:14:30 -07:00
thumbnail.py docs: Remove some outdated references to thumbnailing.md doc. 2022-07-12 17:44:24 -07:00
tutorial.py backend: Add request as parameter to json_success. 2022-02-04 15:16:56 -08:00
typing.py message-type: Add support for "direct" as value for type parameter. 2023-04-18 12:29:33 -07:00
unsubscribe.py black: Reformat with Black 23. 2023-02-02 10:40:13 -08:00
upload.py ruff: Fix RUF015 Prefer `next(...)` over single element slice. 2023-07-23 15:20:53 -07:00
user_groups.py settings: Disallow everyone group for new setting. 2023-09-07 14:21:01 -07:00
user_settings.py inbox: Add inbox as default view. 2023-09-18 12:17:49 -07:00
user_topics.py user_topics: Add a new endpoint to update visibility_policy. 2023-04-03 22:31:49 -07:00
users.py users: Refactor and optimize max_message_id_for_user by removing a join. 2023-09-11 15:00:37 -07:00
video_calls.py python: Replace functools.partial with type-safe returns.curry.partial. 2023-09-11 18:03:45 -07:00
zephyr.py ruff: Fix PLW0602 Using global but no assignment is done. 2023-01-04 16:25:07 -08:00