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

Remove 202 from shouldRetry #183

Closed
wants to merge 1 commit into from
Closed

Remove 202 from shouldRetry #183

wants to merge 1 commit into from

Conversation

Wakeful-Cloud
Copy link

Fixes #182

NOTE: I don't know if http.StatusAccepted is used by other endpoints in cases where the response needs to be retried.

@Wakeful-Cloud Wakeful-Cloud changed the title Fixed shouldRetry Remove 202 from shouldRetry Jan 6, 2022
@strideynet strideynet self-requested a review January 6, 2022 10:06
@strideynet
Copy link
Collaborator

Thanks for raising this. I'll take a look tonight along with the other open PR.

@strideynet strideynet marked this pull request as ready for review January 6, 2022 10:06
@strideynet
Copy link
Collaborator

I'm a little worried this might break some existing retries that are valid, So I'm going to need to take a bit of a deeper look.

@Wakeful-Cloud
Copy link
Author

@strideynet That was my concern too. I wonder if it's possible to analyze a response header/body to determine if the request actually failed or not. Are you aware of any known cases where Spotify returns 202 even though the request should be retried?

@rtrox
Copy link
Contributor

rtrox commented Dec 28, 2022

I was planning on addressing this too, then saw this PR. I think given that StatusAccepted was added for a reason, a safer approach might be to instead change the retry checks in c.execute and c.get to include a check of the needsStatus:

if c.AutoRetry &&
   isFailure(resp.StatusCode, needsStatus) &&
   shouldRetry(resp.StatusCode) {
   // <retry logic>
}

@rtrox
Copy link
Contributor

rtrox commented Dec 28, 2022

gah, sorry, just realized I'm necro-ing a year old PR. will open a new PR for this.

@Wakeful-Cloud
Copy link
Author

#213 seems more complete, closing

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

Successfully merging this pull request may close these issues.

Cannot Set Playlist Image With Autoretry
3 participants