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

Chunked Uploads #36

Merged
merged 4 commits into from
Oct 1, 2024
Merged

Chunked Uploads #36

merged 4 commits into from
Oct 1, 2024

Conversation

WCByrne
Copy link
Member

@WCByrne WCByrne commented Sep 30, 2024

Adds support for chunked uploads under the hood. This does not change the API at all. Uploads will automatically be chunked if the file exceeds 20mb.

@@ -13,7 +13,7 @@ jobs:
- name: Setup node
uses: actions/setup-node@v3
with:
node-version: "18"
node-version: "20.12.2"
Copy link
Member Author

Choose a reason for hiding this comment

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

This shouldn't change anything, just getting in line with our other projects.

spec: "@yarnpkg/plugin-typescript"

yarnPath: .yarn/releases/yarn-3.2.4.cjs
yarnPath: .yarn/releases/yarn-4.5.0.cjs
Copy link
Member Author

Choose a reason for hiding this comment

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

Upgraded yarn to fix an eslint issue

Comment on lines +115 to +125
export async function retry<T>(action: () => Promise<T>, retries = 2): Promise<T> {
for (let i = 0; i <= retries; i++) {
try {
return await action();
} catch (error) {
if (i + 1 > retries) {
throw error;
}
}
}
}
Copy link
Member Author

Choose a reason for hiding this comment

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

This function is used to automatically retry some upload calls. Those tend to be more susceptible to unexpected network errors since they are passing larger files. In many cases a failing asset creation call is hard to repeat later if we want it in the right spot in a kit.

Copy link

@uncultivatedrabbit uncultivatedrabbit left a comment

Choose a reason for hiding this comment

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

So the actual update looks solid to me, but I'm not 100% sure how I would go about testing this since its related to the dev experience right? Not sure if you have thoughts on a solid way for me to whip something together to test this if you wanted me to triple make sure it chunks and uploads large assets for me as well!

@WCByrne WCByrne merged commit 0077f01 into master Oct 1, 2024
1 check passed
@WCByrne WCByrne deleted the chunky-uploads branch October 1, 2024 15:28
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