Skip to content
This repository has been archived by the owner on Jul 15, 2024. It is now read-only.

Improve shopware API client error handling #13

Open
MalteJanz opened this issue Jul 2, 2024 · 0 comments
Open

Improve shopware API client error handling #13

MalteJanz opened this issue Jul 2, 2024 · 0 comments

Comments

@MalteJanz
Copy link
Owner

The client should re-authenticate itself if it needs to (receives a "unauthenticated" response).

This is a little tricky to do properly, one must consider the following invariants:

  • there might be multiple requests running in parallel, ideally you only want to re-auth after the first failure and let the others wait for retry
  • the in_flight_semaphore locks reduce the maximum requests happening at the same time in most cases. We need to be careful to not cause a deadlock

Also the code itself could see some more love and refactoring to remove code duplication

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

No branches or pull requests

1 participant