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

Upstream controller don't abort all requests #38

Merged
merged 3 commits into from
Nov 2, 2023
Merged

Conversation

DiegoRBaquero
Copy link
Contributor

@DiegoRBaquero DiegoRBaquero commented Nov 2, 2023

When there's an upstream controller passed, don't use it as the one passed to each request, but rather proxy the abort to current one only. Also, if upstream controller was aborted, don't try yielding next fallback

@@ -261,6 +265,13 @@ export class Saturn {
}

const fetchContent = async function * () {
const controller = new AbortController();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is nonblocking but I would add this in the fetchCid function instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This special handling of the controller is specific to the fallback one (where there are 5 retries), the fetchCid function should use the one passed by the caller. Can you expand on your thoughts?

@AmeanAsad
Copy link
Contributor

AmeanAsad commented Nov 2, 2023

@DiegoRBaquero LGTM.

@DiegoRBaquero just confirming the intended behaviour here. If the client utilizing this module aborts, that would disable any fallback functionality from occurring.

Also pointing out that we still don't have proper uptstream controller handling for race requests in the js client.

@DiegoRBaquero
Copy link
Contributor Author

@DiegoRBaquero just confirming the intended behaviour here. If the client utilizing this module aborts, that would disable any fallback functionality from occurring.

Correct

Also pointing out that we still don't have proper uptstream controller handling for race requests in the js client. For race requests.

I can also add the functionality to racing, which will be different than fallback's

@DiegoRBaquero DiegoRBaquero merged commit 4bec3a3 into main Nov 2, 2023
1 check passed
@DiegoRBaquero DiegoRBaquero deleted the fix-controller branch November 2, 2023 23:44
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.

2 participants