New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #1053 by changing request body format to params #1054
Fix #1053 by changing request body format to params #1054
Conversation
@@ -26,7 +26,7 @@ async def setUp(self): | |||
].replace("#", "") | |||
client = AsyncWebClient(token=token) | |||
self.channel_id = None | |||
async for resp in await client.conversations_list(limit=10): | |||
async for resp in await client.conversations_list(limit=1000): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To avoid ratelimited errors with my test workspace (it has a very large number of channels)
@@ -621,7 +621,7 @@ async def admin_users_session_getSettings( | |||
kwargs.update({"user_ids": ",".join(user_ids)}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This code currently works but the server-side may stop accepting this format in the future. That's the reason why we want to make the changes in this PR.
Codecov Report
@@ Coverage Diff @@
## main #1054 +/- ##
=======================================
Coverage 84.36% 84.36%
=======================================
Files 95 95
Lines 8937 8937
=======================================
Hits 7540 7540
Misses 1397 1397
Continue to review full report at Codecov.
|
Thanks for your prompt review! |
Summary
This pull request fixes #1053 by eliminating the potential issues with a single comma-separated-value format data for a sequence type parameter (e.g., channel_ids, user_ids, etc.) in JSON request body.
As far as I did tests with the mentioned endpoint, a single CSV format string value works even in the JSON request body. That being said, it should be much safer to switch the content-type from
application/json
toapplication/x-www-form-urlencoded
in the long run. It is a proven way in the Java SDK and some others.We may want to eventually switch all the API methods to
application/x-www-form-urlencoded
for simplicity but it's out of this pull request's scope.Category (place an
x
in each of the[ ]
)/docs-src
(Documents, have you run./docs.sh
?)/docs-src-v2
(Documents, have you run./docs-v2.sh
?)/tutorial
(PythOnBoardingBot tutorial)tests
/integration_tests
(Automated tests for this library)Requirements (place an
x
in each[ ]
)python3 -m venv .venv && source .venv/bin/activate && ./scripts/run_validation.sh
after making the changes.