Skip to content

Conversation

remorses
Copy link

@remorses remorses commented Aug 27, 2025

Summary

Fix tar-parser failing to parse large tar files due to edge case in buffer boundary handling.

Problem

The tar-parser was failing when parsing large tar files. The issue occurred in the #parseBody() method where the parser wasn't properly handling the case when a file's content ended exactly at a buffer boundary.

Solution

This PR addresses the edge case to ensure proper parsing of tar files regardless of size or how file contents align with buffer boundaries.

@Copilot Copilot AI review requested due to automatic review settings August 27, 2025 10:10
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Fixes a critical bug in the tar-parser that caused failures when parsing large tar files due to improper buffer boundary handling in the parseBody() method.

  • Adds proper handling for when file content ends exactly at a buffer boundary
  • Ensures the body controller is properly closed and reset when file reading is complete
  • Includes test coverage with a real-world large repository to validate the fix

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
packages/tar-parser/src/lib/tar.ts Fixes buffer boundary edge case by adding completion check and proper cleanup when #missing reaches zero
packages/tar-parser/src/lib/tar.test.ts Adds integration test using a large GitHub repository to verify the fix works with real-world large tar files

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@remorses
Copy link
Author

remorses commented Oct 1, 2025

@mjackson

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.

2 participants