Skip to content

fix(web): raise an error when apps_icon_set gets neither file nor url - #2060

Merged
mwbrooks merged 1 commit into
mainfrom
zimeg-fix-apps-icon-set-file-or-url
Nov 18, 2026
Merged

mwbrooks merged 1 commit into
mainfrom
zimeg-fix-apps-icon-set-file-or-url

Conversation

@zimeg

@zimeg zimeg commented Nov 18, 2026

Copy link
Copy Markdown
Member

Summary

This pull request makes apps_icon_set raise a SlackRequestError when it gets neither file nor url, following the review on #2058.

  • Without either argument, the call went out and came back as missing_arguments. Now it fails before the request, the way views_update and files_upload do when their required pair is missing.
  • The async and legacy clients are regenerated with scripts/codegen.py, and sync and async tests check the error.

Testing

  1. Call client.apps_icon_set(app_id=...) with neither argument and confirm SlackRequestError: Either file or url must be provided. with no request sent.
  2. Call it with file= or url= and confirm it still sets the icon.

Live check: on main, the same call with neither argument returns missing_arguments from the API.

Category

  • slack_sdk.web.WebClient (sync/async) (Web API client)
  • slack_sdk.webhook.WebhookClient (sync/async) (Incoming Webhook, response_url sender)
  • slack_sdk.socket_mode (Socket Mode client)
  • slack_sdk.signature (Request Signature Verifier)
  • slack_sdk.oauth (OAuth Flow Utilities)
  • slack_sdk.models (UI component builders)
  • slack_sdk.scim (SCIM API client)
  • slack_sdk.audit_logs (Audit Logs API client)
  • slack_sdk.rtm_v2 (RTM client)
  • /docs (Documents)
  • /tutorial (PythOnBoardingBot tutorial)
  • tests/integration_tests (Automated tests for this library)

Requirements

  • I've read and understood the Contributing Guidelines and have done my best effort to follow them.
  • I've read and agree to the Code of Conduct.
  • I have signed the Salesforce CLA (required before your PR can be reviewed or merged).
  • I've run python3 -m venv .venv && source .venv/bin/activate && ./scripts/run_validation.sh after making the changes.

🤖 Generated with Claude Code

Co-authored-by: Michael Brooks <21328+mwbrooks@users.noreply.github.com>
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
@zimeg
zimeg requested a review from a team as a code owner November 18, 2026 18:01
@zimeg zimeg added this to the 3.47.1 milestone Nov 18, 2026
@zimeg zimeg added bug M-T: A confirmed bug report. Issues are confirmed when the reproduction steps are documented semver:patch web-client labels Nov 18, 2026
@zimeg zimeg self-assigned this Nov 18, 2026
@zimeg
zimeg requested a review from mwbrooks November 18, 2026 18:01
@codecov

codecov Bot commented Nov 18, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 83.33333% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 84.63%. Comparing base (e1811b7) to head (d471404).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
slack_sdk/web/legacy_client.py 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2060      +/-   ##
==========================================
+ Coverage   84.60%   84.63%   +0.02%     
==========================================
  Files         118      118              
  Lines       14061    14067       +6     
==========================================
+ Hits        11896    11905       +9     
+ Misses       2165     2162       -3     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@mwbrooks mwbrooks left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Thanks @zimeg! Failing before the request goes out matches how views_update handles its pair, so this reads right at home.

@mwbrooks
mwbrooks merged commit b11b323 into main Nov 18, 2026
19 checks passed
@mwbrooks
mwbrooks deleted the zimeg-fix-apps-icon-set-file-or-url branch November 18, 2026 18:08
@zimeg

zimeg commented Nov 18, 2026

Copy link
Copy Markdown
Member Author

🌟 Thanks for the kind review @mwbrooks!

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

Labels

bug M-T: A confirmed bug report. Issues are confirmed when the reproduction steps are documented semver:patch web-client

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants