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

fix(publishVersion): fix maxBodyLength when uploading to appHub #890

Merged
merged 1 commit into from
Nov 4, 2024

Conversation

Birkbjo
Copy link
Member

@Birkbjo Birkbjo commented Nov 4, 2024

Background

The maps-app failed to uploading using d2-app-scripts publish. See eg. this run: https://github.com/dhis2/maps-app/actions/runs/11663969768/job/32473530177 .
The truncated error made this quite hard to debug - I had to locally run this with a change in node_modules of the platform to see the actual error. So I made it dump the error regardless if it's axios-error.
The reason it failed was due to axios-defaults for maxBodyLength, which appears to be 10MB. However the server should enforce the length, not the client. The server already does this and is currently configured to allow up to 20MB (ref: https://github.com/dhis2/app-hub/blob/master/server/src/routes/v1/apps/handlers/createAppVersion.js#L36 )

Implementation

Adds maxContentLength: infinity; maxBodyLength: infinity to hopefully fix this issue.

@Birkbjo Birkbjo requested a review from KaiVandivier November 4, 2024 12:44
Copy link
Contributor

@KaiVandivier KaiVandivier left a comment

Choose a reason for hiding this comment

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

Seems like a reasonable change 👍 thanks! 🙏

@stian-sandvold stian-sandvold merged commit ea89701 into master Nov 4, 2024
10 checks passed
@stian-sandvold stian-sandvold deleted the fix/publishversion-body-maxlength branch November 4, 2024 14:41
@dhis2-bot
Copy link
Contributor

🎉 This PR is included in version 11.7.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

@dhis2-bot
Copy link
Contributor

🎉 This PR is included in version 12.0.0-alpha.22 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

4 participants