Skip to content

fix(topics): stop resolved titles being overwritten on scheduler check#94

Merged
artyomsv merged 8 commits into
mainfrom
90-sonarr-imported-topics-show-forum-main-page-title-instead-of-release-name-name-disappears-after-first-check
Jun 25, 2026
Merged

fix(topics): stop resolved titles being overwritten on scheduler check#94
artyomsv merged 8 commits into
mainfrom
90-sonarr-imported-topics-show-forum-main-page-title-instead-of-release-name-name-disappears-after-first-check

Conversation

@artyomsv

Copy link
Copy Markdown
Owner

Problem

Sonarr-imported topics (issue #90) showed the forum main-page / category title instead of the release name, and the correct name disappeared after the first scheduler check.

Two independent defects combined:

  1. Unconditional self-heal (all trackers). The scheduler's display-name self-heal overwrote a topic's stored title with Check.DisplayName on any difference — a noisier Check title clobbered a good add-time title every poll.
  2. Kinozal title-host inconsistency. Kinozal's Check fetched its title from the raw mirror host (e.g. kinozal.guru) while the rest of the plugin pins kinozal.tv, so the title source diverged from add-time metadata.

Fix

  • New topics.display_name_is_placeholder provenance flag (migration 0010). Set once at creation: true only when the title is a tracker Parse placeholder; false when caller-supplied or resolved via ResolveMetadata.
  • The scheduler self-heal is gated to fire only while the flag is true, and locks on first resolve — a resolved title can never be downgraded (fixes the class for every tracker, not just Kinozal).
  • UpdateDisplayName clears the flag on resolve; a user rename clears it only on an actual name change.
  • Kinozal Check now canonicalizes its title URL to p.domain (matching ResolveMetadata/fetchInfohash/Download), preserving request-forgery safety — defense-in-depth at the source.
  • Existing rows default to locked (no flapping); already-broken topics are repaired by a manual rename.

Tests

TDD throughout; full suite green with -race (37 packages, gofmt clean). Key regression test: a resolved-title topic whose Check returns a different DisplayName is not overwritten; a placeholder topic is upgraded exactly once, then locked.

Design + plan: docs/superpowers/specs/2026-06-25-self-heal-display-name-gate-design.md, docs/superpowers/plans/2026-06-25-self-heal-display-name-gate.md.

Closes #90

github-actions Bot added 8 commits June 25, 2026 11:29
Design for issue #90. The scheduler self-heal overwrites a topic's
stored title with check.DisplayName on any difference, so a noisier
Check title clobbers a good add-time title every poll. Kinozal also
fetches its Check title from the raw mirror host while the rest of the
plugin pins kinozal.tv, producing the divergent title.

Spec: a display_name_is_placeholder provenance flag (migration 0010)
gates self-heal to placeholder-only and locks on first resolve; plus
canonicalize kinozal's Check title host. Lock all existing rows.
Also apply gofmt to domain/domain.go, topics/create.go, and
kinozal/kinozal_test.go (whitespace-only alignment fixes left by
earlier tasks in the series).
@artyomsv artyomsv enabled auto-merge (squash) June 25, 2026 12:29
@artyomsv artyomsv disabled auto-merge June 25, 2026 12:29
@artyomsv artyomsv merged commit 52e28b6 into main Jun 25, 2026
9 checks passed
@artyomsv artyomsv deleted the 90-sonarr-imported-topics-show-forum-main-page-title-instead-of-release-name-name-disappears-after-first-check branch June 25, 2026 12:30
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.

Sonarr-imported topics show forum main-page title instead of release name (name disappears after first check)

1 participant