Skip to content

feat(watchsync): allow watch-sync batch sizes up to 1000 - #44

Merged
Quick104 merged 1 commit into
mainfrom
feat/watch-sync-batch-1000
Oct 17, 2026
Merged

Quick104 merged 1 commit into
mainfrom
feat/watch-sync-batch-1000

Conversation

@Quick104

@Quick104 Quick104 commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Problem

Related issue: N/A

A watch-sync plugin can declare at most 100 for max_batch_size, so Silo sends it at most 100 plays per ApplyEvents call. A large first sync then costs one round trip per 100 plays. MDBList takes far more per request: 1,000 real plays in one call took 2.3 seconds against its live API. At the MDBList plugin's pace of one request a second, a 13,000-play history needs about 390 requests (6–7 minutes) in batches of 100, and about 50 in batches of 1,000.

Approach

Manifest validation accepts max_batch_size from 1 to 1000. The limit is exported as manifest.MaxWatchSyncBatchSize so a host can size its export pages from it.

The field's proto comment and a new note in docs/compatibility.md say what the value controls: every ApplyEvents call (watched history, watchlist, favorites and ratings) and the page size a host requests from ListRemoteState. A plugin that raises it has to handle batches and pages of that size in every flow it declares.

Release impact: validation gets looser and one constant is added, so this is a minor release, v0.27.0.

Downstream, once v0.27.0 is tagged:

  • silo-server: bump the SDK and take its history export page size from the constant.
  • silo-plugins: bump the SDK, because the catalog tool validates each plugin release with it.
  • silo-plugin-watchprovider-mdblist: bump the SDK and declare 1000.

Validation

  • go test ./...: pass. A new test checks 0, 1, 100, 1000 and 1001.
  • go vet ./...: clean. go build of the four examples: pass.
  • make proto: only the field comment in watch_sync_provider.pb.go changes, with gofmt's column realignment.
  • gofmt -l .: lists only pkg/pluginsdk/runtime/scan_source_test.go, which main already lists.
  • Through a local go.work on this branch, the real MDBList plugin manifest with max_batch_size: 1000 was checked against two validators. silo-server's install check (plugins.ValidateManifest) and the silo-plugins catalog tool (BuildPackageFromRelease) both accept it. On their current SDK pins (v0.26.0 and v0.21.0), both reject it with max_batch_size must be between 1 and 100.

Evidence

Evidence: https://evidence.siloserver.org/r/silo-plugin-sdk/pr-44/

Risks

  • A host or catalog tool built on v0.26.0 or earlier refuses a plugin that declares more than 100: install and load fail, and an older server skips that plugin's catalog entry while other plugins stay listed. Servers need to update before such a plugin ships.
  • Every manifest that validates today still validates.

Checklist

  • I read and can explain the complete diff.
  • This pull request addresses one concern.

AI Disclosure

  • Harness: Claude Code (T3 Code)
  • Tool(s): Claude Code, Claude Code subagents for review, GitHub CLI, buf
  • Model(s): claude-opus-5-5
  • Involvement: AI-assisted. The maintainer chose the change and its compatibility trade-off.
  • Adversarial review: a separate Claude Code subagent reviewed this diff with the silo-server change that uses it. It found that the first comment described the limit as covering only watched-history export, when Silo also uses it for every other ApplyEvents call and the ListRemoteState page size. The comments and docs were corrected.

🤖 Generated with Claude Code

Note

Raise watch-sync max_batch_size limit from 100 to 1000

  • Replaces the hard-coded upper bound of 100 in manifest.validateWatchSyncCapability with the new manifest.MaxWatchSyncBatchSize constant (1000), and includes the limit in the validation error message
  • Documents the 1–1000 range and host/catalog validation requirements in compatibility.md and the proto comments for silo.plugin.v1.WatchSyncProviderDescriptor
  • Adds table-driven tests covering rejection at 0 and 1001, and acceptance at 1, 100, and 1000
  • Risk: manifests with max_batch_size above 100 now pass validation; hosts using the older 1–100 compatibility range must validate it separately

Macroscope summarized 966f5ad.

Manifest validation now accepts max_batch_size from 1 to 1000 and exports
the limit as manifest.MaxWatchSyncBatchSize. The proto comment and
docs/compatibility.md state that the value bounds every ApplyEvents call
and the ListRemoteState page size, and that hosts and catalog tooling on
earlier SDKs reject values over 100.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@silo-triage silo-triage Bot added the size/M 50–199 added + deleted lines (all files); change volume, not priority. label Oct 17, 2026
@silo-kody

silo-kody Bot commented Oct 17, 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 17, 2026 •

Copy link
Copy Markdown

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: b0f2c668-c410-4262-bdff-eade2adcfc89
📥 Commits

Reviewing files that changed from the base of the PR and between 6d71747 and 966f5ad.

⛔ Files ignored due to path filters: 1
  • pkg/pluginproto/silo/plugin/v1/watch_sync_provider.pb.go is excluded by !**/*.pb.go
📒 Files selected for processing: 4
  • docs/compatibility.md
  • pkg/pluginsdk/manifest/manifest.go
  • pkg/pluginsdk/manifest/watch_sync_provider_test.go
  • proto/silo/plugin/v1/watch_sync_provider.proto

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

📝 Walkthrough

The watch-sync batch-size maximum increases from 100 to 1000. Manifest validation, boundary tests, protocol documentation, and compatibility guidance now reflect the limit and version differences.

Changes: Watch sync batch-size limit

Layer / File(s) Summary
Define and validate the batch-size limit
proto/silo/plugin/v1/watch_sync_provider.proto, pkg/pluginsdk/manifest/manifest.go, pkg/pluginsdk/manifest/watch_sync_provider_test.go, docs/compatibility.md
The manifest exports a maximum of 1000 and validates max_batch_size against it. Tests cover valid and invalid bounds. The protocol and compatibility documentation describe the 1–1000 range and note that SDKs before v0.27.0 accept only 1–100.

Priority: ⬇️ Low

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

Change: Feature

Suggested reviewers: crowquillx, rhainland

Merge Risk: ⚪ Minimal · up to 966f5

The batch-size limit and upgrade guidance are aligned in the supplied review context; no actionable merge-blocking risk is identified.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 2 files. (2 skipped: 2… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed 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 primary change: increasing the watch-sync batch-size limit to 1000.
Description check Passed The description is directly related to the changeset. It explains the problem, implementation, compatibility impact, validation, risks, and downstream requirements.
Full details: Docstring Coverage

Explanation

Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 2 files. (2 skipped: 2 unsupported.)

Resolution

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

  • Fix all pre-merge checks with AI
✨ Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · 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.

@silo-triage silo-triage Bot added documentation Improvements or additions to documentation enhancement New feature or request go Pull requests that update go code triaged High-confidence review completed; does not mean fixed, validated, or accepted for release. labels Oct 17, 2026
@Quick104
Quick104 merged commit aa8df5e into main Oct 17, 2026
4 checks passed
@Quick104
Quick104 deleted the feat/watch-sync-batch-1000 branch October 17, 2026 03:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request go Pull requests that update go code size/M 50–199 added + deleted lines (all files); change volume, not priority. triaged High-confidence review completed; does not mean fixed, validated, or accepted for release.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant