Skip to content
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

Python REST API: Fail fast if code is either "UNAUTHORIZED" or "BAD_REQUEST" #783

Open
showell opened this issue May 31, 2023 · 3 comments

Comments

@showell
Copy link
Contributor

showell commented May 31, 2023

The Python REST API has aggressive retry logic if the underlying call to the server in call_on_each_event does not succeed. This retry logic can obscure obvious problems such as somebody having an out-of-date API key or somebody not supplying the correct type of narrow arguments.

There are more details here: https://chat.zulip.org/#narrow/stream/137-feedback/topic/api.20client.20silent.20failure

You will want to discuss the best approaches on Zulip before proceeding, but the basic idea is to look for "UNAUTHORIZED" or "BAD_REQUEST" in the code field that comes back from the server, and if you see those, you should immediately have the function either raise an Exception or somehow make it clear to the API author that they need to fix the problem.

@showell
Copy link
Contributor Author

showell commented May 31, 2023

In particular, it's probably a good idea to mimic what mobile does here: https://chat.zulip.org/#narrow/stream/137-feedback/topic/api.20client.20silent.20failure/near/1582288

There may be some subtle differences for what the Python API does, but the overall philosophy should be the same.

@codewithnick
Copy link

@showell is this the same issue as #533 ?, if we can detect wrong credentials this will be solved as well

@codewithnick
Copy link

codewithnick commented Jan 19, 2024

@timabbott can you please help me with this, the issue #533 looks like the root cause , also i am unable to claim that issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants