Skip to content

Reorder file collection and download link processing in GetFileDownlo…#130

Open
dylanmazurek wants to merge 305 commits into
sirrobot01:betafrom
dylanmazurek:fix-torbox-channel-blocking
Open

Reorder file collection and download link processing in GetFileDownlo…#130
dylanmazurek wants to merge 305 commits into
sirrobot01:betafrom
dylanmazurek:fix-torbox-channel-blocking

Conversation

@dylanmazurek
Copy link
Copy Markdown

Fixed problem with torbox download routines causing Post-Download Action: Download to never complete.

eliasbenb and others added 30 commits January 28, 2025 13:12
* feat: Handle multiple torrent submissions
* perf: Switched from DOM-based to state-based in the main render loop logic

This removes the need to make complicated CSS selectors that would slow down the app.

It also improves debugability and readability.

* feat: Client-side state filtering

* style: Don't wrap the torrent list's header on small screens

* perf: Keep a dictionary of DOM element references
- Upload Torrent file OR magnet URI
- Refractor code
- Add file size and extension checkers
- Change repair workflow to use zurg
- Minor cleanup
- speedgains
- Add funding.yml
- Add Arr Queue cleanner worker
- Rewrote worker
Copilot AI review requested due to automatic review settings August 29, 2025 11:12
Copy link
Copy Markdown

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

This PR fixes a bug in the Torbox download routine where the order of channel processing was causing the "Post-Download Action: Download" to never complete. The fix reorders the file collection and download link processing to ensure proper completion of download operations.

  • Reordered channel processing to handle download links before file collection
  • Added clarifying comment about the reason for the reordering

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

Comment thread pkg/debrid/providers/torbox/torbox.go Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@sirrobot01
Copy link
Copy Markdown
Owner

The issue #123 tagged to this PR was already closed. I don't know what this fixed and how.

The changes don't really resolve anything, really...

@dylanmazurek
Copy link
Copy Markdown
Author

The deadlock occurs because the goroutines send to linkCh before filesCh, but the collecting loops process filesCh before linkCh. This causes goroutines to block on sending to the buffered linkCh (filling its capacity), preventing them from sending to filesCh or calling wg.Done(). The collecting loops then hang waiting for items or closure.

To fix this I reordered the collecting loops in GetFileDownloadLinks to match the send order in the goroutines: collect from linkCh first, then filesCh, then errCh. This ensures sends unblock in sequence without deadlock.

I tested with the current v1.1.3 release and the downloads get stuck and never fully download. With this re-ordering, I am able to see downloads finish and leave the list.

- Introduced a new launch.json file for Go debugging configuration.
- Refactored the Start function in main.go to comment out UMASK handling.
- Cleaned up imports and improved error handling in request.go.
- Enhanced the Debrid struct in debrid.go with synchronization and timing features.
- Updated AllDebrid provider to improve error handling and logging.
- Removed unused realdebrid/misc.go file.
- Added profile handling in Torbox provider and improved torrent management.
- Updated types in torbox/types.go for better clarity and structure.
- Refined account management in account.go for improved functionality.
- Enhanced torrent processing logic in torrent.go and queue.go for better performance.
…spacing and updating comments in various files
@jwhite
Copy link
Copy Markdown

jwhite commented Oct 4, 2025

I can concurr that this change is needed and I tested it.

@NeurekaSoftware
Copy link
Copy Markdown

@sirrobot01 do you think this was related to the streaming issues that I was having with TorBox? I was able to stream for a bit, but then streaming stops working until I restart Decypharr.

@jwhite
Copy link
Copy Markdown

jwhite commented Oct 12, 2025

It would be nice to get this pull request in so that we can take later versions of decypharr with torbox.

@sirrobot01 sirrobot01 changed the base branch from main to beta October 26, 2025 10:52
@rocketprogrammer
Copy link
Copy Markdown

@sirrobot01 do you think this was related to the streaming issues that I was having with TorBox? I was able to stream for a bit, but then streaming stops working until I restart Decypharr.

Having this problem as well.

@lexiismadd
Copy link
Copy Markdown

lexiismadd commented Dec 19, 2025

Having this problem also. The only way to resolve it is restart decypharr after each download, which is bad

@artifishvr
Copy link
Copy Markdown

I can also confirm that this change is needed and I've tested that it resolves the problem I'm having where Torbox downloads will never start.

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.