Skip to content

fix(apiv2): stop documenting the monitor patch fields as nullable - #3535

Merged
Quick104 merged 12 commits into
Silo-Server:mainfrom
blurbery:fix/download-monitor-patch-nullability
Nov 14, 2026
Merged

Quick104 merged 12 commits into
Silo-Server:mainfrom
blurbery:fix/download-monitor-patch-nullability

Conversation

@blurbery

@blurbery blurbery commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Related issue: #2980
Validation tasks: none (only the generated /api/v2 document changes; the server handles requests exactly as before)

#3534, which this built on, has merged, and main is merged into this branch, so the diff against main is this change alone.

The /api/v2 document says all six fields of the download monitor edit (PATCH /api/v2/downloads/subscriptions/{id}) accept null, but the server refuses null on every one of them (since #4064, with a 422 validation_failed naming the field). A client generated from the document can send a request the server will always refuse. This change documents those fields as not nullable, which is what the server and docs/downloads-api.md already say.

The fields are mode, season_numbers, delete_watched, max_storage_bytes, quality and active on DownloadSubscriptionPatchBody. They're nullable in the document because Patch[T].Schema marks every member nullable, while updateDownloadSubscription refuses null for all of them.

Approach

DownloadSubscriptionPatchBody gets a TransformSchema that drops the nullable flag from its members. No other Patch body refuses null on a member, so I kept the fix on this one type rather than adding a second presence-aware type next to Patch. Requests behave the same: Huma treats null on an optional member as absent, so the handler's own check still refuses it. The transport test from #4064 covers null on all six fields, quality included.

With quality no longer nullable, #3534's exemption for it (apiv2.NullEnumWithheld) has nothing left to hold out, so the table and its lint branch go too.

This narrows the request contract, so contracts/api/v2/breaking-approvals.json carries one request-property-became-not-nullable approval per field. First-party clients don't send null here: silo-apple's UpdateSubscriptionRequest is a synthesized Encodable struct of optionals, which leaves nil fields out, and silo-android and the web app don't call this operation.

The web types change to match: the six fields lose | null. Nothing in web/src outside the generated types uses them.

Validation

The contract checks ran on 3d377b78a. The internal/apiv2 tests ran on 3c727c39e, whose internal/apiv2 code is the same; later commits only add the approvals and #3534's lint change.

  • make apiv2-openapi, make verify-apiv2-openapi, make apiv2-web-types and make verify-apiv2-web-types: current.
  • make verify-apiv2-contract against main: the lint passes, and the diff reports the six request-property-became-not-nullable changes on updateDownloadSubscription, each approved, plus fix(apiv2): list null in the enum of nullable request members #3534's non-breaking enum additions.
  • make verify-apiv2-fixtures, the internal/contractspec tests and focused internal/apiv2 tests, including the monitor transport test: pass.
  • go vet on both packages, and golangci-lint --new-from-merge-base on internal/contractspec: clean.
  • The rest of the full gate, including make lint-changed for internal/apiv2, make test-go and the web checks, runs on CI.
  • Benchmarks: not applicable, only the generated document changes.

Evidence

Evidence: none, no user-visible change

No screen changes. What clients see is the GET /api/v2/openapi.json response, which serves the committed contracts/api/v2/openapi.json bytes. DownloadSubscriptionPatchBody, trimmed to type and enum:

Before and after

Before (main at 2d5f22e7d):

active:            {"type": ["boolean", "null"]}
delete_watched:    {"type": ["boolean", "null"]}
max_storage_bytes: {"type": ["integer", "null"]}
mode:              {"type": ["string", "null"]}
quality:           {"type": ["string", "null"], "enum": ["original", "20mbps", "10mbps", "5mbps", "2mbps", "1mbps"]}
season_numbers:    {"type": ["array", "null"]}

After (this branch at 3d377b78a):

active:            {"type": "boolean"}
delete_watched:    {"type": "boolean"}
max_storage_bytes: {"type": "integer"}
mode:              {"type": "string"}
quality:           {"type": "string", "enum": ["original", "20mbps", "10mbps", "5mbps", "2mbps", "1mbps"]}
season_numbers:    {"type": "array"}

Risks

A breaking change to the request contract before the 1.0 lock, approved per field in breaking-approvals.json. A third-party client that sends null for one of these fields is already refused, so only its generated types change. There's no runtime change.

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, GitHub CLI
  • Model(s): claude-opus-5-5
  • Involvement: AI-assisted with Claude Opus. I directed the task and designed the work.
  • Adversarial review: a separate Claude Code subagent (claude-opus-5-5) reviewed the commit without my conclusions. It checked that null still reaches the handler and gets 400, that non-null values validate as before, that no shared schema is mutated, that the transformer applies in both the router and the generator, that the contract diff has no other breaking findings, and that the web types and docs agree. It found nothing blocking; I removed the schema path the nullable enum pass no longer reads.

Note

Mark DownloadSubscriptionPatchBody patch fields as non-nullable in apiv2

  • Adds a Huma TransformSchema method that sets Nullable to false on all six optional DownloadSubscriptionPatchBody properties in download_subscription_mutations.go, so generated OpenAPI and TypeScript schemas drop null from those types
  • Removes the apiv2.NullEnumWithheld exception map and its special handling in admitNullInNullableEnums and lintNullableEnum; the lint now rejects every nullable enum that omits null, and OpenAPI generation adds null to all nullable schema enums
  • Updates contract guidance in api-contract.md and records the six breaking-approvals entries in breaking-approvals.json
  • Behavioral Change: the quality enum in the generated TypeScript schema changes from string-or-null to string; clients previously sending explicit null for these patch fields may now fail validation

Macroscope summarized 34b91af.

JSON Schema 2020-12 applies type and enum separately, so a member typed
["string", "null"] whose enum lists only strings still refuses null.
ProfileUpdate.max_playback_quality (null removes the ceiling) and
AdminItemMetadataUpdate.status (null leaves it unchanged) were documented
that way, so a client that validates against /api/v2 refused a null the
server accepts.

GenerateOpenAPI now adds null to the enum of every nullable component
schema after registration, which replaces the per-type transformer on
AdminPlaybackHistoryEntry. The pass runs on the document only: Huma's
validator accepts null on a nullable schema before it checks the enum,
and the registered enum stays as it was, so the 422 message for a bad
value doesn't gain a null.

DownloadSubscriptionPatchBody.quality is held out through
apiv2.NullEnumWithheld: Patch documents it as nullable, but the handler
answers 400 for null on every monitor field.

The spec lint now fails a nullable enum without null, and fails a
NullEnumWithheld entry once its member no longer needs it.

Closes Silo-Server#2980
goconst flags a string literal used three times, and the nullable enum
rule added the third use of "components.schemas.". The contract doc
now says which locations the lint checks: members and array items.
Patch documents every member as nullable, so the updateDownloadSubscription
body advertised null for mode, season_numbers, delete_watched,
max_storage_bytes, quality and active. The handler answers 400 for null on
each of them, and docs/downloads-api.md already says null is rejected.

DownloadSubscriptionPatchBody now drops the nullable flag from its members.
Requests are handled as before: Huma treats null on an optional member as
absent, and the handler's check still answers 400.

With quality no longer nullable, the nullable enum exemption has nothing
left to hold out, so NullEnumWithheld and its lint branch go.

This narrows the request contract and needs a breaking-change approval.
The path only keyed the exemption table, which the previous commit
removed.
@silo-triage silo-triage Bot added the size/M 50–199 added + deleted lines (all files); change volume, not priority. label Nov 5, 2026
@coderabbitai

coderabbitai Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Warning

Review limit reached

This organization requires a seat for paid usage-based reviews, including automatic and on-demand reviews. Ask an admin to assign a seat or enable paid usage-based reviews for users without a seat in Billing.

Next included review available in 44 seconds.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

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: 5c5b8f0e-3ba3-4ab3-bdcb-568a27761ada
Commits

Reviewing files that changed from the base of the PR and between 691ae8b and 34b91af.

Files selected for processing: 8

  • contracts/api/v2/breaking-approvals.json
  • contracts/api/v2/openapi.json
  • docs/architecture/api-contract.md
  • internal/apiv2/document.go
  • internal/apiv2/download_subscription_mutations.go
  • internal/contractspec/lint.go
  • internal/contractspec/lint_test.go
  • web/src/api/v2/schema.ts

No actionable comments were generated in the recent review.

Walkthrough

The API v2 contract changes update nullable-enum processing and lint rules. Six optional download-subscription PATCH fields no longer accept null in the OpenAPI and TypeScript schemas.

Changes: API v2 Nullability

Layer / File(s) Summary
Nullable-enum generation and linting
internal/apiv2/document.go, internal/contractspec/lint.go, internal/contractspec/lint_test.go, docs/architecture/api-contract.md
Nullable schemas with nonempty enums receive null during schema processing. The linter reports nullable enums that omit null. Tests and documentation no longer include the withheld-entry exception.
Download-subscription PATCH field contract
internal/apiv2/download_subscription_mutations.go, contracts/api/v2/openapi.json, web/src/api/v2/schema.ts, internal/apiv2/download_subscription_mutations_test.go, contracts/api/v2/breaking-approvals.json
The PATCH schema transform marks its properties non-nullable. The six optional fields no longer accept null in the OpenAPI and TypeScript schemas. The transport test expects null quality to return HTTP 400, and the approval file records six changes.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Bug fix

Suggested reviewers: quick104

Merge Risk: Minimal · previous review 2047d

This change documents six PATCH fields as non-nullable, which matches what the server already enforces, so request handling is unchanged. No actionable merge-blocking risk was found.

Architecture risk: Low · up to 572d3

The change affects 4 systems.

Changed systems: internal, contracts, docs, web

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — internal (service) was modified; 5 changed files map to changed impact.
  • observed — contracts (api) was modified; 2 changed files map to changed impact.
  • observed — docs (service) was modified; 1 changed file maps to changed impact.
  • observed — web (api) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in contracts/api/v2/breaking-approvals.json: The previously empty approvals array now contains six records for updateDownloadSubscription, each approving request-property-became-not-nullable with a distinct fingerprint, the same reason, and #3535.
  • observed — Modified behavior in internal/apiv2/download_subscription_mutations.go: Adds the Huma package import.
  • observed — Modified behavior in internal/apiv2/download_subscription_mutations.go: Adds DownloadSubscriptionPatchBody.TransformSchema, which sets each schema property’s Nullable flag to false and returns the schema.
  • observed — Modified behavior in internal/apiv2/download_subscription_mutations_test.go: The invalid PATCH body cases now include quality: null; the test expects it to return HTTP 400, like the existing invalid cases.
Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: the monitor patch fields are no longer documented as nullable in the /api/v2 contract. The changeset matches this. It removes null from six DownloadSubscriptionPatchBo…
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 description is specific and on-topic. It explains that the /api/v2 OpenAPI document marks six DownloadSubscriptionPatchBody fields (mode, season_numbers, delete_watched, max_storage_bytes, quality…
Full details: Title check

Explanation

The title names the main change: the monitor patch fields are no longer documented as nullable in the /api/v2 contract. The changeset matches this. It removes null from six DownloadSubscriptionPatchBody fields in the OpenAPI document, the web types, and the apiv2 transformer, and it removes the NullEnumWithheld exception. The title uses the fix(apiv2) prefix and stays within one sentence.

Full details: Description check

Explanation

The description is specific and on-topic. It explains that the /api/v2 OpenAPI document marks six DownloadSubscriptionPatchBody fields (mode, season_numbers, delete_watched, max_storage_bytes, quality, active) as nullable, while the server rejects null for them. It states the change: a TransformSchema on DownloadSubscriptionPatchBody that drops nullability, removal of the NullEnumWithheld exception table, regenerated OpenAPI and web types, breaking-approvals entries, and a transport test for quality: null. It also covers validation runs, risks, and the behavioral note. This matches the changeset in the raw summary.

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: d0968e62-73ce-4618-bf22-a525f819c659
Commits

Reviewing files that changed from the base of the PR and between 572d355 and 2047d5e.

Files selected for processing: 2

  • contracts/api/v2/breaking-approvals.json
  • internal/apiv2/download_subscription_mutations.go
Files skipped from review as they are similar to previous changes: 2

  • contracts/api/v2/breaking-approvals.json
  • internal/apiv2/download_subscription_mutations.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.

@silo-kody

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

One request-property-became-not-nullable approval per field of
updateDownloadSubscription, ratified in Silo-Server#3535.
@macroscopeapp

macroscopeapp Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

This changes only OpenAPI schema metadata and generated client types; it does not change the rendered UI or runtime API behavior covered by the visible-change criteria. Add Evidence: none, no user-visible change under the Evidence heading.

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

Posted via Macroscope — Visible change evidence

@silo-triage silo-triage Bot added size/L 200–499 added + deleted lines (all files); change volume, not priority. api-v2 API v2 / Huma migration program (epic #135); long-running, stacked by phase bug Something isn't working go Pull requests that update go code priority: P2 Limited scope, workaround exists, or polish and removed size/M 50–199 added + deleted lines (all files); change volume, not priority. labels Nov 5, 2026
The nullable enum rule walked only members and array items, so a nullable
enum in a oneOf, anyOf or allOf branch or a typed map value passed the lint
although the generator covers those places. The rule now has its own walk
over all of them.
…tch-nullability

# Conflicts:
#	docs/architecture/api-contract.md
#	internal/contractspec/lint_test.go
@silo-kody

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

@Quick104

Quick104 commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

🤖 Claude Code (claude-opus-5-5)

Review summary

Reviewed head: 59ae8fbc9c. That's 3d377b78a6 with current main merged in. Main had changed openapi.json, schema.ts and api-contract.md since this branch was cut, and regenerating both artifacts after the merge left them byte-identical. The review covers this PR's own commits (8c507f6bc, 3c727c39e, deab15f5b). #3534's commits are reviewed on #3534.

Findings: none in this PR's diff.

What I checked:

  • After the merge, verify-apiv2-contract reports six request-property-became-not-nullable changes on updateDownloadSubscription, each approved, and nothing else breaking. The only other changes are fix(apiv2): list null in the enum of nullable request members #3534's enum additions. verify-apiv2-openapi, verify-apiv2-web-types and verify-apiv2-fixtures pass.
  • The transformer changes only these six members. Patch[T].Schema returns a fresh copy per member, so the other Patch bodies (profiles, markers, preferences, devices, ebook annotations) stay nullable. Each of those handlers treats null as "clear". That backs the PR's claim that no other body needs this.
  • The focused internal/apiv2 and internal/contractspec tests pass. The new {"quality":null} row also passes on the base, which is expected: the runtime doesn't change, and the row guards that.
  • silo-apple's UpdateSubscriptionRequest uses a synthesized Encodable of optionals, so it leaves out unset fields and never sends null here.

Left for maintainers:

Validated features: none affected. Only the generated /api/v2 document and web types change, and request handling stays the same.

User manual: unaffected. The change is to the API document, not to anything the manual describes.

Apple/Android parity: not an app PR. No client change is needed, as noted above.

Fit: 9/10 · Readiness: 9/10 — ready (once #3534 merges)

Fit: the PR makes the published v2 contract match what the server and docs/downloads-api.md already do, ahead of the 1.0 lock. It's scoped to the one type that needs it and doesn't add a second presence-aware type.
Readiness: the regenerated document shows exactly the six intended changes, each with a recorded approval, and nothing else moves.

…patch-nullability

Silo-Server#3534 merged with its own NullEnumWithheld table, its lint branch, and a
check that each entry names a member. This branch removes the table, so
the conflicts resolve to this branch's side and the entry check goes too.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@silo-triage silo-triage Bot added size/M 50–199 added + deleted lines (all files); change volume, not priority. and removed size/L 200–499 added + deleted lines (all files); change volume, not priority. labels Nov 13, 2026

@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.

🤖 Claude Code (claude-opus-5-5)

I merged main into this branch (572d355) now that #3534 has landed. The four conflicts were all in #3534's NullEnumWithheld table, which this PR deletes, so each one resolved to this branch's side. main's version of #3534 had also added a test that each table entry names a real member; that test went with the table. The contract diff against main now reports only this PR's six approved request-property-became-not-nullable changes.

One minor finding, below.

Silo-Server#4064 changes the answer to null on a monitor field from 400 to 422, so
the TransformSchema comment and the approval reasons say the handler
refuses null rather than naming the status.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@silo-kody

silo-kody Bot commented Nov 13, 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 ❌
⚠️ 4 Kody Rule(s) were not evaluated

These rules declare that they need repository context beyond this diff, and the review could not retrieve it, so they were not judged on this pull request:

  • Preserve optional store capabilities through production wrappers
  • Detach mandatory cleanup from request cancellation and bound its lifetime
  • Preserve durable media identity and share identity-evidence precedence
  • Bound decoder throughput trades and share direct-play eligibility

@Quick104

Quick104 commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

🤖 Claude Code (claude-opus-5-5)

Review summary

Reviewed head: 34b91af

On main, the /api/v2 document lists all six DownloadSubscriptionPatchBody members as nullable, but updateDownloadSubscription refuses null on every one of them (a 422 naming the field since #4064), and docs/architecture/api-contract.md allows explicit null only on nullable PATCH members. This PR fixes the document so it matches the server and docs/downloads-api.md. Requests are handled exactly as before.

Branch update. I merged main after #3534 landed. The conflicts were all in the NullEnumWithheld table this PR removes, so they resolved to this branch's side, and the check main had added for the table's entries went with it. After #4064 merged, I merged main again (691ae8b). The transport test took main's side, so this branch no longer changes that test: #4064's test covers null on all six fields at 422. Then #4074 and #4159 changed this handler's error mapping on main, so I merged main once more (34b91af). It merged cleanly. Neither PR changed a schema, and regenerating the document and web types changed nothing.

Addressed. The TransformSchema comment and the six approval reasons named the 400 status, which #4064 changes to 422. They now say the handler refuses null, which reads correctly whichever PR merges first (2047d5e).

Checked with no finding.

  • Patch[T].Schema returns a fresh copy for each member, so clearing Nullable changes no schema another type shares. Huma calls the transform once, and the router and the generator both see it.
  • Huma skips null on an optional member before the schema's nullability matters, so {"quality":null} still reaches the handler, which refuses it. fix(apiv2): answer null on a monitor field with 422 naming it #4064's transport test covers this for all six fields.
  • No other Patch member I checked is documented nullable while its handler refuses null. Profiles, for example, accept null on every Patch member.
  • No test proves the fix, because runtime behavior doesn't change. The fix is in the generated document, and make verify-apiv2-openapi gates that.

Verification on 34b91af. make verify-apiv2-openapi, make verify-apiv2-web-types, make verify-apiv2-fixtures, and make verify-apiv2-contract against main pass. The contract diff shows the six approved request-property-became-not-nullable changes and nothing else. go test ./internal/apiv2/... ./internal/contractspec/... passes, TestSubscriptionMutationTransport included, and make lint-changed reports 0 issues.

Validated features. No passed case is affected. I couldn't read the validation board, so I read the Validation-labelled tasks instead: #1168 C1–C2, #1167, silo-apple#319, and silo-android#329. None covers editing download monitors. Validation tasks: none stands.

User manual. Unaffected. Only the API document changes, and the manual doesn't describe this request's schema.

Other clients. silo-apple's UpdateSubscriptionRequest is a synthesized Encodable of optionals that leaves nil fields out, so it never sends null. Code search found no caller in silo-android or silo-roku, and the web app only has the generated types. No parity work is needed.

Fit: 9/10 · Readiness: 9/10 — ready (assuming CI is green)

…patch-nullability

Silo-Server#4064 answers null on a monitor field with 422 naming the member and
covers all six fields, quality included, in its own transport test, so
the transport test takes main's side and this branch no longer lists
{"quality":null} among the 400 cases.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Quick104
Quick104 merged commit e39b8ea into Silo-Server:main Nov 14, 2026
8 checks passed
Quick104 added a commit to Rhainland/silo-server that referenced this pull request Nov 14, 2026
The contract check reads Silo-Server#3535's approvals in the merge base as stale for
this branch, as earlier pull requests have found.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Quick104 added a commit to blurbery/silo-server that referenced this pull request Nov 14, 2026
Silo-Server#3535 is on main, so its six breaking-change approvals no longer match a
change between this branch and its base, and the contract gate fails on
them as stale.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Quick104 added a commit that referenced this pull request Nov 14, 2026
The six updateDownloadSubscription entries were approved in #3535 and match no
change against the current base, so the contract gate fails every pull request
until they go.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Quick104 added a commit that referenced this pull request Nov 14, 2026
…s language (#4189)

* fix(watch-providers): say which action failed and why, in the viewer's language

Watch-provider toasts showed only the raw failure text: a request's English
developer message for a timeout, a failed fetch, or a proxy page, and the
generic conflict line in other languages when connecting before the code was
approved. Each failure now names the action as the toast title and explains it
below in the interface language.

The poll answer now tells its outcomes apart: an expired code is
device_login_expired (410), an authorization already completed is
already_linked, a declined one is not_permitted, and a code not approved yet
stays conflict with an English detail a person can act on. A plugin's EXPIRED
and DENIED answers map to the same outcomes instead of a 500.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(watch-providers): answer a repeated poll with the connection and explain a declined one

Finishing a device authorization again after its first answer was lost now
returns the connection that answer created, instead of an error while the card
still shows "not connected". A used code with no connection left reads as
expired. A declined authorization gets its own line on the web rather than the
shared "That isn't allowed." text, and a failure to save the provider's pending
challenge reads as a server error rather than "approve the code first".

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(watch-providers): report a failed connection read on a repeated poll as a server error

A completed session's retry read the connection and treated any failure as an
expired code; a database or provider status failure now answers as itself.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* chore(apiv2): drop breaking-change approvals that already merged

The six updateDownloadSubscription entries were approved in #3535 and match no
change against the current base, so the contract gate fails every pull request
until they go.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* chore(i18n): sync translations from release 2026.11.14-295ae4b

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(watch-providers): drop a device code the poll says can't finish

An expired, used, declined, or unknown code (410, 403, 404) stayed on the
card with its "I've entered it" button, so selecting it again repeated the
same refusal. Clear it like Cancel does so the card offers Connect again.
A code not approved yet (409) stays.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Quick104 added a commit that referenced this pull request Nov 15, 2026
…it (#4195)

* fix(catalog): keep durable provider IDs in step with an admin's ID edit

The admin metadata edit stored an IMDb, TMDB or TVDB ID exactly as typed and
left the item's durable provider ID behind. A padded ID ("550 ") missed exact
lookups, and a corrected or cleared one kept the old durable ID, which
lookups, AttachTMDBID's conflict check and a refresh's ID seeding read; a
refresh restored a cleared ID from it.

The v2 PATCH now stores each ID the way a refresh stores it: trimmed, IMDb in
lowercase, a TMDB URL slug dropped. It answers 422 at the member for a value
that is no ID of its provider. On a movie or series, the same transaction
replaces or removes the durable row for each edited provider. An ID another
item already holds stays on the column only, as before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* chore(apiv2): clear breaking-change approvals that have merged

The six updateDownloadSubscription entries merged with #3535. An approval
lives only on the pull request that needs it, so the next pull request
removes it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* perf(catalog): let the edited ID's holder check use the provider ID key

Wrapping held.provider in lower() kept the check from using the
(provider, provider_id, item_type) unique key, so every edited ID scanned
media_item_provider_ids. That key compares the provider exactly, so an exact
match is also what decides whether the insert would conflict.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(catalog): lock the item before replacing its provider IDs

A curator's ID edit locks the item FOR UPDATE, then deletes its provider
row. A standalone ReplaceByContentID (book enrichment, a legacy refresh)
deleted the item's rows first and then waited on that lock for its
inserts, so the two deadlocked. It now locks the item first, as the edit
does, and the two queue instead.

The test's lock-wait check now looks only at this database and the
statement it expects to block, since CI runs packages against separate
databases on one server.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(catalog): leave the durable row alone when an edit resends an ID

An edit form resends IDs the item already has. lockCuratedProviderIDs
treats those as unchanged and skips its checks, so the durable-ID sync now
skips them too and writes only IDs the edit actually changes, compared the
same way (trimmed, any case).

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(metadata): lock the item before a drift repair replaces its provider IDs

An admin's ID edit now locks the item and then deletes the edited
provider's row. The startup provider-ID drift repair deleted the item's
rows first and needed the item for its inserts' foreign-key check, so an
edit and a repair of the same item could deadlock and fail the edit.
The repair now locks the item first, as ReplaceByContentID does.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* refactor(catalog): reuse contentid's provider names in the ID-edit sync

Drops the package's second copy of the tmdb, imdb and tvdb names, keeps
each stored ID beside its provider instead of in a map, and corrects the
sync's comment now that ReplaceByContentID locks the item. The admin API
doc now says a resent, unchanged ID leaves the durable ID alone.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(metadata): lock a skeleton before a rebind moves its provider IDs

An automatic rebind moved the skeleton's provider rows and only locked
the skeleton at its final delete. An admin's ID edit locks the item and
then deletes one of those rows, so the two could deadlock and fail the
edit or the refresh. The rebind now locks the skeleton after its files
and before its provider rows, the order the edit and refresh use.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(metadata): skip a drift repair whose item changed while it waited

The repair reads an item's ID columns in its batch query and only locks
the item later. When it waited behind an admin's ID edit, it then wrote
the IDs it had read before the edit over the edited durable ID. It now
re-reads the columns under the lock and leaves the item for the next run
when they changed, or when the item is gone.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(metadata): lock and re-check the item before moving a provisional claim

The drift repair's provisional-owner branch locked only the owner, then
deleted the drifted item's provider rows and wrote the IDs it had read in
its batch. Like the clean-insert branch before 7497947, it could
deadlock with an admin's ID edit of that item, or write back the IDs the
edit replaced. Both branches now share one check that locks the item
first and skips it when its IDs changed; the owner is locked after it,
the order the edit takes the item and the holders of its IDs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(metadata): skip a provisional owner that lost the drifted ID

The repair picks a provisional owner before it locks anything, and after
53718d2 it can wait on the drifted item first. It then deleted all of the
owner's provider rows even when an edit had moved the owner off the ID in
the meantime. It now checks, under the owner's lock, that the owner still
holds one of the IDs, and leaves the owner for the next run otherwise.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api-v2 API v2 / Huma migration program (epic #135); long-running, stacked by phase bug Something isn't working go Pull requests that update go code 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