webui: drop the details pane when its torrent disappears, and let detail polls fail quietly - #3168
Merged
Merged
Conversation
…ail polls fail quietly When the torrent shown in the details pane is erased or replaced while the pane is open, ruTorrent keeps rendering it: theWebUI.dID still points at a hash that is gone from dataTorrents, and the cached files/dirs/peers/trackers for that hash are never freed (the trackers map was also missing from the cleanup on the normal removal path). Meanwhile the file/peer/tracker detail multicalls for the vanished hash fault, and because they are flagged important the failure surfaces as a red XMLRPC error dialog for what is a routine race between polling and erase. Clear the pane and its caches when the hash disappears from the list, and let a detail poll answer with an empty result instead of an error. Co-Authored-By: Claude Fable 5 <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.
Problem. When the torrent shown in the details pane is erased or replaced while
the pane is open,
theWebUI.dIDstill points at a hash gone fromdataTorrents:the pane freezes on stale data and the cached files/dirs/peers/trackers for that
hash are never freed (the trackers map was missing from the normal removal path
too). The file/peer/tracker detail polls for the vanished hash fault, and being
flagged important they surface as a red XMLRPC error dialog — for a routine race
between polling and erase.
Fix. Clear the pane and its caches when the hash disappears from the list;
httprpcmarks the f/p/t detail multicalls not-important and answers an emptyresult instead of an error when they fail.
How to verify. New
tests/js/webui-stale-details.spec.js. Manual: open atorrent's details, erase that torrent from another tab — before: frozen pane and an
error popup; after: the pane clears silently.