-
Notifications
You must be signed in to change notification settings - Fork 12
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
API: use APIv3 endpoint for resources #468
base: main
Are you sure you want to change the base?
Conversation
Initial implementation as a POC to give it a try. It works fine at first sight and I think it could be a good idea to move forward with it. I didn't find any blocker yet. Closes #356
const filetreediffResponse = fetch( | ||
addons.readthedocs.urls.api.v3.filetreediff, | ||
); |
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.
I worry a little bit about one of the API calls failing and leading to weird state. Would be good to put a TODO in here probably to do a retry?
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.
Yes. I need to re-write this code to handle errors as well. Currently, if an API call break, the whole code breaks completely 😅
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.
@agjohnson what's the best pattern to use for this chunk of code? async/await Promise
s (as it's written) or then-able
s?
My goal here is to make multiple requests in parallel to APIv3 while handling errors. Besides, once that all requests have responded, I want to use the respond data to form the config
object with the same structure we currently have.
Initial implementation as a POC to give it a try. It works fine at first sight and I think it could be a good idea to move forward with it. I didn't find any blocker yet.
Closes #356
Requires readthedocs/readthedocs.org#11831