fix: use filepath.Rel for cross-volume NZB/PAR2 output paths#205
Merged
fix: use filepath.Rel for cross-volume NZB/PAR2 output paths#205
Conversation
Non-folder mode used strings.TrimPrefix to compute relative paths for NZB and PAR2 output, which silently failed when watch and output folders had different path prefixes (e.g. different drives). This caused output files to land in the watch folder instead of the configured output directory. Replace all four TrimPrefix call sites with a new relativePathFrom helper that uses filepath.Rel, matching the robust approach already used by folder mode's deriveFolderName. When paths cannot be made relative (cross-volume on Windows), falls back to placing output directly in the output directory root. Also enhance the e2e fake NNTP server to accept POST commands so upload-to-NZB e2e tests can verify file placement end-to-end. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The TestOutputDir_UploadPlacesNzbInOutputDir test timed out in CI because post_check was enabled with a 10s delay, making the upload take too long. Disable post_check alongside par2 for faster completion. Also fix TestOutputDir_ConfigCanBeCleared to use a real temp dir instead of "/some/path" which caused permission denied errors when the processor tried to create it. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The waitForQueueComplete helper used json:"total" but the /api/queue endpoint returns "totalItems", so the field was always zero and the poll loop never terminated. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Chromium on newer Linux kernels intermittently crashes with "ThreadCache::IsValid" in scheduler_loop_quarantine_support.h. Disabling the PartitionAlloc feature avoids this crash. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
strings.TrimPrefixwithfilepath.Relfor computing relative output paths in non-folder mode, fixing NZB/PAR2 files landing in the watch folder instead of the configured output directory when they're on different drivesrelativePathFromhelper that gracefully falls back when paths can't be made relative (e.g. cross-volume on Windows)Test plan
TestPostCrossVolumeNZBInOutputDir,TestPostInParallelCrossVolumeNZBInOutputDir,TestPostCrossVolumeWithSubdirectoryTestOutputDir_UploadPlacesNzbInOutputDir,TestOutputDir_ConfigPersistsRoundTrip,TestOutputDir_ConfigCanBeCleared,TestOutputDir_IndependentOfSingleNzbPerFoldergo build ./...passesgo test -race ./pkg/postie/...passesgo vet ./...passes🤖 Generated with Claude Code