Skip to content

fix(markers): log when online lookups wait for setup to finish - #1997

Merged
Quick104 merged 2 commits into
Silo-Server:mainfrom
Rhainland:fix/intro-markers-fetch
Oct 7, 2026
Merged

Quick104 merged 2 commits into
Silo-Server:mainfrom
Rhainland:fix/intro-markers-fetch

Conversation

@Rhainland

@Rhainland Rhainland commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Related issue: #1249
Validation tasks: none

Online marker lookups (TheIntroDB) stay off until the setup wizard records setup.completed, so an admin can turn them off first. A server set up without finishing the wizard still logs lazy playback lookups as queued and answers admin refresh-markers with "queued", then fetches nothing and leaves no trace of why. During the iOS Series validation this looked like a marker regression.

Approach

The population service logs one warning per process the first time it skips a lookup for this reason, naming the setup.completed setting. It checks markers.mode first, so a server with online lookups set to local or off gets no notice. Behaviour is unchanged.

Validation

  • go build, go vet, gofmt, make lint-changed: pass.
  • make test-go: the only failures are the hardware-acceleration, transcode and probe tests that also fail on main on the test machine (macOS, no VAAPI, QSV or NVIDIA devices). A few timing tests that failed once while the machine was loaded passed on three reruns.
  • make verify-settings-bindings-all, the other verify-* targets in CONTRIBUTING, and the router artifact test: pass.
  • A test checks that repeated lookups and refreshes before setup log the warning exactly once, and that mode local logs nothing.
  • Manual: on the test server, setting setup.completed made the next playback fetch Breaking Bad S01E02's intro from TheIntroDB.

Evidence

Evidence: none, no user-visible change

Risks

None identified.

Checklist

  • I read and can explain the complete diff.
  • This pull request addresses one concern.
  • The Evidence section shows every change a user can see, or says there is none.

AI Disclosure

  • Harness: Claude Code, running in T3 Code
  • Tool(s): Claude Code subagents, Go toolchain, Docker, GitHub CLI
  • Model(s): claude-opus-5-5
  • Involvement: Fully AI-generated, human verified
  • Adversarial review: A separate Claude Code reviewer agent (claude-opus-5-5) read this branch's diff against main at medium effort, checking API compatibility, behaviour, tests and commit hygiene. It checked the once-per-process guard and nil-safe logging. No findings.

Note

Log once when online marker lookups wait for setup to finish

Online and combined marker modes now emit a single process-wide warning when markers.PopulationService.enabled sees incomplete setup, using an atomic flag to suppress duplicate warnings. Local mode no longer reads setup.completed and exits silently.

  • Extracts a markers.Registry.log accessor in types.go that returns the configured registry logger or the process default, and reuses it for both provider-error logging and the setup-wait warning
  • Expands tests in population_test.go to cover per-mode gating, provider/storage non-invocation, and one-time warning emission
  • Behavioral Change: local mode no longer reads setup.completed; online/combined lookups log a warning and stay disabled until setup completes

Macroscope summarized 1a6e9ee.

Online marker lookups stay off until the setup wizard records setup.completed, so the admin can turn them off first. A server set up without finishing the wizard still logged lazy playback lookups as queued and answered admin refresh-markers with queued, then fetched nothing and left no trace of why.

The population service now logs one warning per process the first time it skips a lookup for this reason, naming the setup.completed setting.
@silo-kody

silo-kody Bot commented Oct 5, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@coderabbitai

coderabbitai Bot commented Oct 5, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3932faf3-2d07-4823-af42-544f8686c82d
📥 Commits

Reviewing files that changed from the base of the PR and between 79bdf8b and 1a6e9ee.

📒 Files selected for processing (2)
  • internal/markers/population.go
  • internal/markers/population_test.go

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 1 remain after this review.


📝 Walkthrough

Walkthrough

PopulationService checks its mode before reading setup status. When setup is incomplete, it remains disabled and logs the warning once per process. Registry uses a shared logger fallback.

Changes

Setup Warning Logging

Layer / File(s) Summary
Setup check and warning logging
internal/markers/population.go, internal/markers/types.go, internal/markers/population_test.go
PopulationService checks the mode before setup status and uses an atomic flag to log the incomplete-setup warning once. Registry.log returns the configured logger or slog.Default(), and logProviderError uses this helper. Tests verify behavior in local and online modes, repeated Populate and Refresh calls, and warning frequency.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Feature

Suggested reviewers: quick104

Merge Risk: ⚪ Minimal · up to 1a6e9

The production service shares one warning limit across its consumers. No remaining issue in the reviewed changes blocks merging.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 3 functions across 3 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly and concisely describes the main change: logging when online marker lookups wait for setup completion.
Description check ✅ Passed The description directly explains the skipped online lookups, the one-time warning, mode gating, tests, validation, and expected behavior.
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Quick104 commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Silo's pull request guidance changed today (#2016). A PR that changes what a user sees now needs before-and-after evidence in its Evidence section, and a PR with no visible change says Evidence: none, no user-visible change. This PR was opened before the rule existed, so it hasn't had a chance to meet it yet.

Missing here: Needs the line 'Evidence: none, no user-visible change'.

The rules are in Show visible changes, and the PR template shows the Evidence section layout. I've converted this PR to draft for now. Mark it ready for review once the Evidence section is filled in.


Generated by Claude Code

@Quick104
Quick104 marked this pull request as draft October 6, 2026 19:21
@Rhainland
Rhainland marked this pull request as ready for review October 6, 2026 19:28

@Quick104 Quick104 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One low-severity finding, which I'm fixing on this branch. The summary comment follows once the fix is pushed.

Review by Claude Code (claude-opus-5-5).

Comment thread internal/markers/population.go Resolved
The setup-wait warning ran before the markers.mode check, so a server
with markers set to local or off logged that online lookups were paused
until the wizard finished, though finishing it would not start them.
Check the mode first.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@silo-kody

silo-kody Bot commented Oct 7, 2026 •

Copy link
Copy Markdown

Silo Kody — review complete

Review finished. Check the inline comments for findings and verify each suggestion against the code and tests.

Reviewing changes in Silo
  • Include the related issue, expected behavior, and validation steps in the PR description.
  • For API changes, describe the effect on Apple and Android clients and Jellyfin compatibility.
  • For plugin changes, identify the affected SDK contract, plugin, and catalog entry.
  • Follow this repository's AGENTS.md and CONTRIBUTING.md.
  • Request another review with @kody start-review in a PR comment.
  • React with 👍 or 👎 to give feedback on individual suggestions.
Review settings
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ❌

@Quick104

Quick104 commented Oct 7, 2026

Copy link
Copy Markdown
Contributor

Review summary

Reviewed head: 1a6e9ee68 (the original 79bdf8bd6 plus one fix commit).

Fit: 8/10 · Readiness: 9/10 — conditional

Addressed

  • Low: the setup notice could name lookups that are switched off. The warning ran before the markers.mode check, so a server set to local or off would log that online lookups were paused until the wizard finished. Fixed in 1a6e9ee: enabled now checks the mode first, and the test also covers mode local. The test fails without the fix. Thread resolved.

Remaining

None in the diff. Kody and CodeRabbit left no findings.

Fit

The log addresses a real gap. An admin who creates the account and leaves the wizard keeps setup.completed false, and online marker lookups stay off with no trace. The change adds no settings or API surface, and it logs once per process from the single population service. The score is 8, not higher, because the admin still sees nothing in the UI. The refresh-markers action keeps reporting "queued", and the only signal is a server log line. A later change could surface the paused state where the admin acts, for example in the refresh response or on the markers settings page. That's a product call, not a condition for this PR.

Validated features

No passed case on the v1.0 board reaches this code. The Series tasks this PR relates to (#1250, #1251, #1252, apple#337, apple#338, android#347, android#348) have no passed cases yet. Validation tasks: none is correct.

Checks

All required checks pass on 1a6e9ee68. Locally, go test ./internal/markers/ and make lint-changed pass.

User manual

This PR doesn't affect the manual, since it only adds a log line. A separate gap already exists: the markers page says "Markers work without setup" and doesn't mention that online lookups wait for the setup wizard. I recommend a siloserver.org issue for running-a-server/markers.md, and maybe the TheIntroDB row in help/privacy.md.

Apple and Android

Server-only log, so no client change is needed.

Review by Claude Code (claude-opus-5-5). The verdict is conditional because Fit is below 9. Readiness has no open conditions.

@Quick104
Quick104 merged commit c98ff5b into Silo-Server:main Oct 7, 2026
18 checks passed
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.

2 participants