fix(importer): prevent panic on NZB files with segment-less entries#306
Merged
javi11 merged 6 commits intojavi11:mainfrom Feb 20, 2026
Merged
fix(importer): prevent panic on NZB files with segment-less entries#306javi11 merged 6 commits intojavi11:mainfrom
javi11 merged 6 commits intojavi11:mainfrom
Conversation
…k/strm paths Also updates CI to use a cleaner dev image timestamp (YYYYMMDD-HHmm) in Eastern Time.
Fixes a critical 'index out of range [0]' panic in the NZB parser when processing files with empty segment lists. This often occurs during fallbacks after network validation failures. - Added safety check in parseFile for empty segment slices. - Updated fallbackGetFileInfos to skip files without segments. - Improved normalizeSegmentSizesWithYenc to fetch missing first segment headers instead of zeroing out the size. - Added comprehensive unit tests in parser_test.go covering empty and mixed segment scenarios.
This change introduces a new API endpoint to allow users to permanently reset their persistent import history. - Added ClearImportHistory to the database Repository to perform the deletion. - Added handleClearImportHistory API handler to process the request. - Registered DELETE /api/import/history route in the server. - Verified that NNTP provider errors can already be reset via POST /api/system/stats/reset.
…enabled Ensures postprocessor uses the original full path for metadata lookup and mount path resolution, while using the stripped path only for the final destination in the import directory. This fixes 'no such file or directory' errors for symlink/STRM creation when complete_dir stripping is active.
javi11
approved these changes
Feb 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Fixes a critical
index out of range [0]panic in the NZB parser when processing malformed or incomplete NZB files that contain entries with zero segments. This was particularly prevalent when the parser fell back tofallbackGetFileInfosafter failing to retrieve first-segment data from the network.Changes
parseFileto return an error if a file has no segments, preventing a panic during segment sorting or first-segment access.fallbackGetFileInfosto proactively skip file entries that lack segments.normalizeSegmentSizesWithYencto attempt fetching yEnc headers for the first segment if they aren't already cached, avoiding an issue where segment sizes were incorrectly set to zero during fallbacks.internal/importer/parser/parser_test.gowith unit tests for:Impact
Improves system stability by preventing application crashes when encountering bad NZB data or experiencing network-related metadata fetch failures.