Skip to content

fix(collections): report MDBList's reason when a list feed refuses - #3481

Merged
Quick104 merged 3 commits into
Silo-Server:mainfrom
blurbery:fix/mdblist-error-message
Nov 4, 2026
Merged

Quick104 merged 3 commits into
Silo-Server:mainfrom
blurbery:fix/mdblist-error-message

Conversation

@blurbery

@blurbery blurbery commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Related issue: N/A
Validation tasks: none

When an MDBList list is private, every sync of a collection built from it fails with a JSON decoding error instead of saying the list is private. The web app shows that error as the "Sync failed" tooltip on the Collections page and in the admin collection list, so the person who owns the collection can't tell what to fix.

MDBList's /json feed doesn't use an error status for this. It answers with status 200 and an object in place of the list:

{"error": "This List is Private"}

fetchMDBListJSONPage only checks the status code, then decodes the body as a list, so the sync records parsing mdblist response: json: cannot unmarshal object into Go value of type []usercollections.mdblistEntry. I hit this on my own server: one personal collection has failed every nightly sync since its list went private.

Approach

When the body doesn't decode as a list, fetchMDBListJSONPage now checks whether it's an {"error": "..."} object and, if so, returns mdblist: <message>. Because it's stored and shown as the sync message, the message is trimmed, passed through logredact.RedactSecretAssignments, and capped at 200 characters. Any other body that isn't a list still returns the decoding error as before.

The fix is in internal/collectionutil, so it covers every caller of the shared fetcher: library collections, personal collections, Seasonal Picks and Discover rows. No API fields change.

On a personal collection, only the first sync on import saves a failure. Sync now and scheduled syncs don't save it, so the collection keeps showing whatever its last saved sync said, and Sync now shows "An unexpected error occurred." for any source. That's a separate problem, fixed in #3487. Admin collection syncs save their failures and show the message this PR fixes.

Validation

  • go test ./internal/collectionutil/ ./internal/usercollections/: pass. The new table test covers the private-list reply, a secret assignment in the reason, a long reason, an object without error, and a body that isn't JSON. Its private-list and long-reason cases fail on main.
  • go vet ./internal/collectionutil/: clean.
  • End to end on a local build: imported the same private MDBList list through the web app on main and on this branch, against the same database. Results are under Evidence.
  • CI: the full gate passed on e46eaa917.

Evidence

Evidence: https://evidence.siloserver.org/r/silo-server/pr-3481/

last_sync_message from GET /api/v2/collections/{id} after importing the same private list (web app, local build; main at 6aa6791ea vs this branch at e46eaa917):

Before After
parsing mdblist response: json: cannot unmarshal object into Go value of type []usercollections.mdblistEntry mdblist: This List is Private

The web app shows this text as the tooltip on "Sync failed". A screenshot can't show a native tooltip, so the evidence page's Collections captures from both builds include a clearly marked box with the tooltip text read from the page, alongside the steps used.

Risks

None identified. The change only rewrites the error text for one kind of failed sync.

Checklist

  • I read and can explain the complete diff.
  • This pull request addresses one concern.
  • Each test this pull request adds meets "Decide what to test" in CONTRIBUTING.md.
  • The Evidence section shows every change a user can see, or says there is none.

AI Disclosure

  • Harness: Claude Code (desktop app)
  • Tool(s): Claude Code
  • Model(s): claude-opus-5-5
  • Involvement: AI-assisted. AI-assisted with Claude Opus. I directed the task and designed the work.
  • Adversarial review: n/a

MDBList's /json feed answers a private list with status 200 and an
{"error": "..."} object instead of entries. The sync then failed with a
JSON decoding error that hid the reason. Return the feed's own message,
bounded to 200 characters, and keep the decoding error for anything else.
@silo-triage silo-triage Bot added the size/M 50–199 added + deleted lines (all files); change volume, not priority. label Nov 4, 2026
@silo-kody

silo-kody Bot commented Nov 4, 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 Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

When an MDBList response cannot be decoded as a JSON list, the fetch path checks for a feed-provided error message. It returns the trimmed, redacted message, limited to 200 runes, when available. Otherwise, it returns the existing wrapped parsing error. Tests cover both outcomes.

Changes: MDBList feed error reporting

Layer / File(s) Summary
Error extraction and validation
internal/collectionutil/mdblist.go, internal/collectionutil/mdblist_paging_test.go
The fetch path extracts a feed-provided message, redacts secret assignments, and limits the message to 200 runes. Tests cover private-list errors, redaction, long messages, and parsing-error fallbacks.

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

Change: Bug fix

Possibly related PRs

Suggested labels: impact: usability

Suggested reviewers: quick104

Merge Risk: Minimal · up to e46ea

Private-list sync failures now show the feed's own error message instead of a JSON decoding error. The message is sanitized and length-limited. No merge-blocking risk was found.

Security architecture risk: Low · up to e46ea

External-service explanations now appear in saved sync status and logs. Their length is limited, recognized secret assignments are masked, and reviewed displays treat them as text. No new permissions or executable behavior were identified, but validation of every destination is incomplete.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • observed — The new content exposure follows existing personal and library collection status storage, Discover refresh diagnostics, and Seasonal failure records and logs. This is shared diagnostic propagation, not evidence of expanded permissions; the audience of every downstream route and log destination was not exhaustively mapped.

Security Findings and Attack Paths

  • inferred — The inspected trace does not establish disclosure of server-held credentials or executable interpretation of the feed message. The sensitive-data candidate remains deferred because its required verification receipt is missing; this uncertainty is not a verified vulnerability.

Trust Boundaries and Controls

  • observed — Existing URL validation rejects userinfo, non-allowlisted hosts, and unexpected ports; the MDBList client wrapper revalidates redirects. Fetching remains context-bound with a four-MiB response-read limit. Inspected collection APIs serialize failure messages as strings, and reviewed React consumers render text or title attributes rather than raw HTML.
Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documenta… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title names the main change: when an MDBList list feed refuses a request, the fix reports the feed's reason (e.g., a private list) instead of a JSON decoding error. The raw summary, objectives, an…
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.
Description check Passed The pull request description directly explains the MDBList error-handling changes, user impact, implementation approach, tests, validation, and risks.
Full details: Title check

Explanation

The title names the main change: when an MDBList list feed refuses a request, the fix reports the feed's reason (e.g., a private list) instead of a JSON decoding error. The raw summary, objectives, and description all describe this change in internal/collectionutil/mdblist.go and its tests. The title follows the conventional commit style and is specific enough for a teammate scanning history.

Full details: Docstring Coverage

Explanation

Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 3 functions across 2 files.

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches
Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7d371429-cc15-498d-8617-fd8cc0cad037
Commits

Reviewing files that changed from the base of the PR and between 9e9c932 and e46eaa9.

Files selected for processing: 2
  • internal/collectionutil/mdblist.go
  • internal/collectionutil/mdblist_paging_test.go

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

Comment thread internal/collectionutil/mdblist.go Resolved
@silo-triage silo-triage Bot added bug Something isn't working go Pull requests that update go code impact: polish Annoyance, cosmetic, or nice-to-have priority: P2 Limited scope, workaround exists, or polish labels Nov 4, 2026
@macroscopeapp

macroscopeapp Bot commented Nov 4, 2026

Copy link
Copy Markdown

The Evidence section lacks the screen captures needed to review these visible changes:

  • Personal Collections page — the failed-sync tooltip changes from the generic parse error to MDBList’s refusal message; please add before-and-after captures of the same page with the tooltip open.
  • Admin collection list — the failed-sync message is exposed in the title tooltip/accessibility text; please add before-and-after captures of the same list with the message shown.

The section provides before-and-after message text and explains that the branch has not been deployed, but it does not show the affected screens. Please identify the surface and build or commit for each capture; the stated capture limitation is noted for maintainer review.

Automated check: Macroscope check run agent (gpt-6-luna). Evidence was not reviewed for correctness.

Posted via Macroscope — Visible change evidence

@coderabbitai coderabbitai Bot added the impact: usability Core flow broken or severely blocked label Nov 4, 2026
@silo-kody

silo-kody Bot commented Nov 4, 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 ❌

The feed's message is stored and shown as the sync message, so run it
through logredact.RedactSecretAssignments before the length cap, as other
free-text diagnostics that cross a boundary do.
@silo-kody

silo-kody Bot commented Nov 4, 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 merged commit f395c14 into Silo-Server:main Nov 4, 2026
20 checks passed
@blurbery
blurbery deleted the fix/mdblist-error-message branch November 6, 2026 00:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working go Pull requests that update go code impact: polish Annoyance, cosmetic, or nice-to-have impact: usability Core flow broken or severely blocked priority: P2 Limited scope, workaround exists, or polish size/M 50–199 added + deleted lines (all files); change volume, not priority.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants