Repository navigation
fix(ui): Turbo init markers, torrent and command pollers, Prowlarr/Seerr/Discover/qBittorrent fixes, 502 envelopes (review 3/7) - #137
Open
ndandan wants to merge 3 commits into
Conversation
… §1)
H1 Sonarr library import sends the scanned folder as `path` (template +
seriesAdd) so Sonarr adopts the existing files instead of creating an
empty folder named after its own format. AC-9: one raw lookup instead
of two SkyHook round trips.
H2 Collection "Follow" uses the null-safe bulk endpoint; updateCollection()
itself now GET-merge-PUTs (a partial PUT wiped profile/root/tags).
H3 Radarr queue "Import" goes through the manual-import preview by
downloadId (RadarrClient::manualImportFromQueueItem, mirroring Sonarr),
and the page only deletes the queue item once Radarr reports it
imported (or removed it); otherwise it shows Radarr's state.
H4 File managers read /films/languages and /series/languages (each app's
own /api/v3/language) instead of a literal table that mapped 7 of 12
names to the wrong id.
H5 Every stored language / releaseType (unknown, multiSeasonPack) /
combined indexerFlags is representable in the row, so "Save all" no
longer rewrites untouched rows; an empty language list is never stored.
AC-10 "Move files" (default on) on films/series path edits, update-path
buttons and bulk-edit modals → `?moveFiles=true` / editor `moveFiles`.
AC-7 Radarr/Sonarr write helpers share get()'s connected-then-timed-out
breaker exemption, through a new protected exec() cURL seam (same
pattern as BazarrClient) that the new contract tests drive.
Tests: ArrClientWriteContractTest, RadarrClientManualImportTest,
MediaArrWritePathsTest, ArrWriteTemplateGuardTest. PHPStan baseline:
stale curl_setopt_array/json_decode entries removed (errors gone).
(cherry picked from commit bd7d2cb)
S1 TrustedProxiesSubscriber re-resolves the REMOTE_ADDR placeholder of
TRUSTED_PROXIES on every request (priority 1024, before the router):
Kernel::preBoot() resolved it once per FrankenPHP worker, pinning each
worker to whoever hit it first (the healthcheck). Default value kept so
LAN + cloudflared-on-the-docker-network deployments keep working; README,
.env and compose example now say what REMOTE_ADDR implies and when to
pin a CIDR. ProfilerGuardSubscriber checks the raw peer as well as the
forwarded client ip.
S2 Settings import: only keys the app knows (form fields, kill switches,
display options, sidebar/dashboard families, Wokeometer switches); a
*_url that moves to another host clears that service's stored secrets
(flat keys and instances — ServiceInstanceProvider::clearApiKey());
display preferences go through the same normalizer as the form (AS-10).
S3 HealthService::urlBlockedReason() refuses hosts with anything but
hostname characters / a bracketed IPv6 literal; the settings form and
the import refuse such *_url values; CspHeaderSubscriber::extractOrigin()
accepts only http(s) + a syntactically valid host + numeric port, so a
stored URL can no longer inject a script-src directive.
S4 Escaped the remaining innerHTML sinks: collections overview/poster/title,
series episode title / history badges / add-modal tag label / lookup
network, films tpl() banners (command messages, lookup titles, indexer
names), films_missing command messages, Radarr library-import names and
titles, Seerr Jellyfin username (|raw), Seerr services field values.
TemplateEscapingGuardTest covers each sink; its header no longer claims
'unsafe-inline'.
S5 ServiceRouteGuardSubscriber (7) and MultiInstanceBinderSubscriber (6)
now run after the firewall (8); an unknown instance slug is no longer
health-probed (bogus status pooled forever).
DD-15 Discover loadDetail() validates type (movie|tv) and a numeric id.
(cherry picked from commit cdd38f9)
H6 Topbar search / sidebar toggle init markers are a WeakSet on the live
element (a Turbo snapshot clones data-init but not the listeners), and
the search's document-level handlers are replaced per init.
H7 qBittorrent route-guard rules are URL-only (issue #10 proxy setups).
MS-3 Prowlarr Enabled/Disabled filter reads the form-switch state.
AS-5 HomeController's last-visited pre-check delegates to the route guard's
own service list (ServiceRouteGuardSubscriber::serviceIdForRoute).
DD-1 Dashboard edit-mode Save only touches sections the client listed.
DC-3 Torrent pages skip a timer tick while a fetch is in flight.
DC-2 Usenet visibility handler bound per page instance, torn down on Turbo.
MT-6 Films: a movie leaving the queue is verified via /info before being
painted "Downloaded"; /films/queue answers 502 on an outage.
MT-7 Command pollers end on aborted/cancelled/orphaned, cap at 240 polls,
give up after 5 "unknown" answers, are cleared on Turbo navigation, and
reload only while their page is still on screen.
MT-8 Films warnings poll pauses while the tab is hidden.
MT-9 Sequence tokens on the add lookups, quick-add resolve and quick-look
open (a stale failure no longer navigates away); Clear aborts the
in-flight search; the series Import button stays disabled mid-POST.
MT-10 series/bulk/refresh (one RefreshSeries) and series/bulk/search (one
endpoint issuing SeriesSearch per id, counting rejections).
AS-6/HC-4 Banner Retry maps labels (Seerr, Radarr 4K) to a service id and
HealthService::invalidate() clears the per-instance breaker keys.
AS-8 service_not_configured renders into base's `body` block.
MS-2 Seerr user creation: no password = Seerr generates one; username kept.
MS-7 Prowlarr toggle PUTs with forceSave=true and surfaces the error.
MS-8 Seerr request edit modal loads the request's own server profiles.
DD-5 Discover links carry the owning instance slug (lib_slug).
DD-7 Watchlist toggle honours an explicit add/remove, survives a race,
rejects non-string title/notes.
DC-4 qBittorrent "200 Fails." is a failure (exec() seam on postAction).
DC-5 qBittorrent "Completed" = 100 %; DC-6 Seeds column sortable;
DC-11 tracker seed/leech counts (Transmission real, Deluge "—").
MS-13 Seerr logs page capped at 10 000. MS-12 Tautulli Load more counts
rows and ignores a double-click.
Also: JellyseerrClient exec() seam + recordError() on the breaker branch
(C1), TQ-6 PollerVisibilityGuardTest no longer accepts an inverted check.
(cherry picked from commit 89f9612)
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.
Third PR of the review-2026-11-06 series (stacked on the deployment-posture PR).
What this fixes (user-visible breakage)
data-init"already initialised" marker, so nothing was attached. Init state is tracked per element (window._prismarrBoundWeakSet), duplicate document listeners are removed, and a stale quick-search answer cannot overwrite a newer one.registerPageLifecycle()helper inbase.html.twigcarries the teardown.200 Fails.on a rejected action is now a failure (postAction()through anexec()seam).ApiClientErrorTrait::clientFailed()→ 502 envelope).Tests
Controller tests for each JSON path,
JellyseerrClientWriteContractTestandQBittorrentPostActionTestthrough the clients'exec()seams, andReviewSection3TemplateGuardTestfor the inline-JS shapes (Turbo markers, in-flight guards, poller caps, stale-response tokens).Notes for upstream
The quick-look sequence token was applied to upstream's inline trigger handler (the fork has a separate
qlOpenUrl()); the Prowlarr toggle adaptation targets upstream's button markup.