Skip to content

fix(importer): fix segment validation - #222

Merged
javi11 merged 1 commit into
mainfrom
fix/rar-validation-packed-size
Jan 5, 2026
Merged

fix(importer): fix segment validation #222
javi11 merged 1 commit into
mainfrom
fix/rar-validation-packed-size

Conversation

@javi11

@javi11 javi11 commented Jan 5, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Fix RAR archive validation failing for password-protected or compressed archives
  • Validation was comparing uncompressed file size (~30GB) against packed segment data (~298MB)
  • Add PackedSize field to track compressed size separately from Size (uncompressed)
  • Use PackedSize for segment validation since segments contain packed RAR data

Test plan

  • Existing RAR processor tests pass with new Size/PackedSize assertions
  • Build succeeds
  • Manual test with password-protected RAR archive import

🤖 Generated with Claude Code

RAR archive validation was failing for password-protected or compressed
archives because it compared the uncompressed file size from RAR headers
against the packed segment data size. For compressed/encrypted RAR files,
these values differ significantly (e.g., 30GB unpacked vs 298MB packed).

- Add PackedSize field to Content struct for compressed size tracking
- Set PackedSize from rardecode's TotalPackedSize during processing
- Use PackedSize instead of Size for segment validation in aggregator
- Update tests to verify both Size and PackedSize are correctly set

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@javi11 javi11 changed the title fix(importer): use PackedSize for RAR segment validation fix(stream, importer): fix segment validation and streaming buf Jan 5, 2026
@javi11 javi11 changed the title fix(stream, importer): fix segment validation and streaming buf fix(importer): fix segment validation Jan 5, 2026
@javi11
javi11 merged commit 00e6a0d into main Jan 5, 2026
1 check passed
@javi11
javi11 deleted the fix/rar-validation-packed-size branch February 4, 2026 13:40
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