Skip to content

zulip: Add remove_storage helper to Client.#916

Open
hanyucrocks wants to merge 2 commits into
zulip:mainfrom
hanyucrocks:add-remove-storage-helper
Open

zulip: Add remove_storage helper to Client.#916
hanyucrocks wants to merge 2 commits into
zulip:mainfrom
hanyucrocks:add-remove-storage-helper

Conversation

@hanyucrocks
Copy link
Copy Markdown
Collaborator

Mirrors update_storage and get_storage, sending DELETE to /bot_storage. With no argument, removes all data stored for the bot; passing {"keys": [...]} removes only the specified entries.

The corresponding endpoint is bot-only as of Zulip 12.0 (API feature level 494), so this helper only succeeds for bot users.

Fixes #637.

Self-review checklist
  • Self-reviewed the changes for clarity and maintainability
    (variable names, code reuse, readability, etc.).

Communicate decisions, questions, and potential concerns.

  • Explains differences from previous plans (e.g., issue description).
  • Highlights technical choices and bugs encountered.
  • Calls out remaining decisions and concerns.
  • Automated tests verify logic where appropriate.

Individual commits are ready for review (see commit discipline).

  • Each commit is a coherent idea.
  • Commit message(s) explain reasoning and motivation for changes.

Completed manual review and testing of the following:

  • Visual appearance of the changes.
  • Responsiveness and internationalization.
  • Strings and tooltips.
  • End-to-end functionality of buttons, interactions and flows.
  • Corner cases, error conditions, and easily imagined bugs.

@chrisbobbe
Copy link
Copy Markdown

It looks like you wrote documentation for this, in zulip/zulip#38786 . Thanks for that!

I think a code comment linking to https://zulip.com/api/remove-bot-storage would be helpful here, but (from a quick look) it looks like that's not been our practice in this code. Is @amanagr the right person to confirm that we want to start doing that?

@amanagr
Copy link
Copy Markdown
Member

amanagr commented May 12, 2026

That looks right as being helpful.

@hanyucrocks
Copy link
Copy Markdown
Collaborator Author

Thanks @amanagr! Quick clarification before I update, since update_storage and get_storage don't currently link to their REST API docs either, would you prefer:

  1. Just add the link on remove_storage or
  2. Add links on all three storage helpers as a small prep commit, so the file is uniform?

Happy to go either way.

@amanagr
Copy link
Copy Markdown
Member

amanagr commented May 12, 2026

  1. would be really nice.

Thanks!

Adds `# See https://zulip.com/api/...` references above the
update_storage and get_storage helpers.

Done in preparation for adding remove_storage, so all three
storage helpers carry the same reference.
Mirrors update_storage and get_storage, sending DELETE to
/bot_storage. With no argument, removes all data stored for the
bot; passing {"keys": [...]} removes only the specified entries.

The corresponding endpoint is bot-only as of Zulip 12.0 (API
feature level 494), so this helper only succeeds for bot users.

Fixes zulip#637.
@hanyucrocks hanyucrocks force-pushed the add-remove-storage-helper branch from aeb6249 to 1fe5158 Compare May 12, 2026 12:22
@hanyucrocks
Copy link
Copy Markdown
Collaborator Author

@amanagr I have

  1. Added links on all the three endpoints (it's in the prep commit).
  2. Added the remove_storage helper. (2nd commit).

Let me know if any further changes are required. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add remove_storage helper to the Python API.

4 participants