- Always force re-download once when both JVM and legacy extractors fail
(suggestRedownload=true), regardless of valid archive signature
- Add autoRecoveredForRedownload Set for loop protection (one attempt per archive)
- Clear loop protection on package reset (clearHybridArchiveState)
- Previous sibling-items check failed when other episodes were already
cleaned up after hybrid extraction
- Lower mini-download retry threshold from 100KB to 5KB
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Retry extraction with 2.5s delay on CRC/password errors (Windows file handle race)
- Improve auto-recovery: force re-download when known password fails (content corruption)
- Expand auto-recovery to wrong_password category for encrypted RAR5
- Add fsync after download for pre-allocated files
- Fix permanent extraction failure loop for archives with valid headers but corrupt content
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Switch JVM GC from SerialGC to G1GC with MaxGCPauseMillis=50
for shorter pause times in long-lived daemon
- Increase JVM heap from 512m/8g to 1g/32g to reduce GC pressure
on systems with plenty of RAM
- Raise hybrid thread cap from floor(cpuCount/2) capped 8
to ceil(cpuCount*0.75) capped 12 — downloads are I/O-bound
and don't need much CPU headroom
- Refresh daemon process priority before each request so hybrid
extraction gets correct CPU priority even if daemon was started
with a different priority level
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Early-exit now also uses raw Content-Length as fallback when
totalBytes is unknown (provider returned fileSize=0)
- Stall handler checks if file is already complete on disk before
deleting and retrying — prevents re-download loop for files that
finished but server delayed closing the connection
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add scheduler generation counter to prevent stale scheduler from
continuing after stop/start cycle
- Guard processItem stop-abort handler: skip status overwrite when a
new start() has already re-activated the session
- Yield in start() after recoverRetryableItems to let pending abort
handlers complete before evaluating item states
- Add test: rapid stop → disable provider → start must resolve
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Files with valid RAR/7z/ZIP signature are not corrupt (wrong password),
only files with invalid signature get force-redownloaded.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Trust extractor CRC verdict over file size checks
- Re-queue incomplete downloads instead of just warning
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
If the primary extractor (7-Zip) fails with wrong_password/checksum
error on a .rar file, automatically try the alternative extractor
(UnRAR/WinRAR) which handles RAR format natively and more reliably.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Items incorrectly marked as "completed" by the old 50% recovery threshold
persist in the session file across updates. On startup, check all completed
items: if the file on disk is smaller than expected totalBytes, reset to
"queued" so it gets re-downloaded. Also reset items whose files are missing.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Two bugs in findReadyArchiveSets disk-fallback:
1. Failed items were explicitly excluded from the blocking check
(status !== "failed"), so partial downloads with "failed" status
would not block extraction. Now ANY non-completed item blocks.
2. The disk size check was only > 10 KB, allowing 627 MB partial
files of 1001 MB archives to pass. Now requires the file to be
within one allocation unit of the item's expected totalBytes.
Added findItemByDiskPath helper to look up the owning item for a
file on disk and get its expected size.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Item-Recovery incorrectly marked partially downloaded files as "completed"
when the file size was >= 50% of expected size. A 627 MB partial download
of a 1001 MB file (62.7%) would pass the check and trigger hybrid
extraction on incomplete RAR archives.
Fix: require file to be within one allocation unit (4 KB) of the expected
size instead of 50%. Also add a pre-allocation guard: if the file appears
to be at the expected size but downloadedBytes is significantly behind
(< 95%), skip recovery (likely a pre-allocated sparse file from a crash).
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Detect items whose targetPath has a " (N)" suffix from the previous
duplicate filename bug and rename them back to the original filename.
This fixes extraction failures for RAR split archives that were
downloaded with (1) suffix before v1.7.19.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace shared currentKeyIndex round-robin with sequential scan from
first key. All parallel items now consistently use the same key (e.g.
Key 3) until it hits a quota/error, then all move to Key 4, etc.
Previously, currentKeyIndex was shared across parallel unrestrict calls,
causing items to scatter across keys (3, 5, 7) even when Key 3 still
had capacity.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
After restart, reservedTargetPaths (in-memory) was empty so claimTargetPath
could not distinguish between "file belongs to this item" and "file belongs
to another item". The naive fix (allow overwrite if unclaimed) would have
risked overwriting completed files from other items.
Proper fix: restore reservedTargetPaths from persisted session data on init.
This way each item's targetPath is correctly claimed, and claimTargetPath
can safely reuse the item's own file while protecting other items' files.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>