Skip to content

Improve ZIP handling and compatibility with upload pipeline#241

Open
VanshikaSabharwal wants to merge 3 commits intometacall:masterfrom
VanshikaSabharwal:fix-type
Open

Improve ZIP handling and compatibility with upload pipeline#241
VanshikaSabharwal wants to merge 3 commits intometacall:masterfrom
VanshikaSabharwal:fix-type

Conversation

@VanshikaSabharwal
Copy link
Copy Markdown

Description

  • This PR updates the ZIP utility to ensure compatibility with the deployment/upload pipeline by converting the archiver output into a Blob instead of returning the Archiver instance directly.

Changes I made:-

  • Collect ZIP data chunks from archiver stream using data event
  • Concatenate chunks into a single Buffer
  • Return a Blob (application/x-zip-compressed) instead of Archiver
  • Added explanatory comment about why Archiver cannot be used directly

Reason:-
The archiver package does not return a native Node.js Readable stream. Instead, it extends readable-stream's Transform, which causes issues when passing it to the deployment protocol (e.g., instanceof Readable checks fail).

This resulted in incompatibility with the upload mechanism.

By buffering the archive output and returning it as a Blob, we ensure:

  • Compatibility with the existing upload pipeline
  • Avoidance of stream-type mismatches
  • Consistent behavior across environments

Working GitHub workflow Link:- https://github.com/VanshikaSabharwal/faas/actions/runs/24439286633/job/71400355463

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.

1 participant