Skip to content

fix(test): patch metacall protocol to ensure chunked deployment#125

Open
codxbrexx wants to merge 1 commit intometacall:masterfrom
codxbrexx:fix/deploy-protocol-patch
Open

fix(test): patch metacall protocol to ensure chunked deployment#125
codxbrexx wants to merge 1 commit intometacall:masterfrom
codxbrexx:fix/deploy-protocol-patch

Conversation

@codxbrexx
Copy link
Copy Markdown
Contributor

Summary

This PR patches @metacall/protocol inside the Docker test environment to prevent a 400 Bad Request error when deploying packages via metacall-deploy --dev during FaaS integration tests.

Issue screenshot

image

The patch invalidates the getLengthSync method on the form data object, forcing axios to fall back to Transfer-Encoding: chunked. This bypasses a bug where archiver miscalculates the size of the multipart body, which causes Express to drop the connection due to Content-Length header mismatches.

Related issue

  • Extracted from Fix/ci integration tests #122
  • Maintainer test requirement note: This PR solves an existing test. Specifically, it fixes the test.sh integration suite that was previously failing with an AxiosError: Request failed with status code 400 when executing metacall-deploy --dev.

Type of change

  • Bug fix
  • New feature
  • Documentation
  • Chore / CI
  • Breaking change

How to test

  1. Checkout the branch fix/deploy-protocol-patch
  2. Run sudo docker compose down --remove-orphans && sudo docker compose up --build --exit-code-from test
  3. Verify that the integration tests successfully deploy applications and pass without failing on code 5 (Axios 400 Bad Request).

Checklist

  • I have read the contributing guidelines
  • I added tests that prove my fix is effective or that my feature works
  • I updated documentation if necessary

Notes for reviewers

This patch is applied using a sed replacement inside the Dockerfile specifically in the test stage. It does not affect the production faas runtime image overhead in any way.

Release notes

Fixed Content-Length header mismatch bug crashing metacall-deploy --dev in FaaS integration tests.

@prathamtomar99
Copy link
Copy Markdown

Hi @codxbrexx , I was also trying to locally deploy the whole things but didnt worked out
Possible issues : CLI sends raw files → no zip → wrong field names → server rejects with 400 (so getting the issue X AxiosError: Request failed with status code 400)
Also i was facing some issue during docker deployment. Are you still working on them?

@codxbrexx
Copy link
Copy Markdown
Contributor Author

@prathamtomar99 Yes

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