Repository navigation
fix(sections): cap profile section item limits at 500 - #3050
Conversation
A profile's home-section override accepted any positive item_limit, and the section fetchers size their slices and maps from that value. One profile could save item_limit=1000000000 and make every home load try to allocate gigabytes, crashing the server. Profile overrides now share the admin section cap of 500 (sections.MaxItemLimit). The v2 schema declares the maximum, the shared save path refuses larger values with invalid_item_limit so /api/v1 gets the same check, and the resolver clamps stored values so rows saved before this change can no longer reach the fetchers. The v2 contract diff flags the new maximum as a breaking request change; breaking-approvals.json carries the two entries, with approved_in set to a placeholder until the pull request number exists. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
A profile override saved before the cap can still hold a value above 500. The web editor sends back the saved item_limit of every row it did not touch, so any later save of that page would be refused. List the overrides with the limit capped, as the resolver already applies it. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
Warning Review limit reachedEnable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing. Next included review available in 8 minutes. View limit details
Comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
|
The Evidence URL contains the literal
Suggested fix: publish the evidence for this PR and replace Automated check: Macroscope check run agent (gpt-6-luna). Evidence was not reviewed for correctness. Posted via Macroscope — Visible change evidence |
…ients card Review fixes: - Keep an untouched quota bucket for seven days in memory and Redis instead of until the last request's rate would have refilled it, so lowering the rate cannot hand a drained session a fresh burst. - Refresh the Busiest API clients card with the rest of the dashboard. - Keep the sign-out dialog open until the request settles, so a failure shows its error. - Derive the web session quota type from the generated v2 schema, and add api_clients to the capability example in docs/admin-api.md. - Drop the two approvals #3050 left in breaking-approvals.json; the base already contains the changes they approve. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…eam main Outside pull requests the fork checks its API contract against upstream main. Upstream main already has Silo-Server#3050's item limit change, so its two approvals match no change in that diff and the check rejects them as stale. The fork's approvals go back to the empty list it had before the sync, which is also what Silo-Server#2891's PR head has.
The contract diff refuses approvals that match no change. Against current main, the two section-override approvals from Silo-Server#3050 match nothing, so the check fails for any branch from main until they are removed.
- A sync whose session row fails to save writes nothing else: the client gets an error and syncs again, and the retry would count the same listening twice. - A sync's or close's listening time is bounded to [0, 1 day] before it is added to the session's stored total. - Remove the breaking-change approvals Silo-Server#3050 added; they match no change now that Silo-Server#3050 is in main. Co-Authored-By: Claude Opus 5.5 <[email protected]>
* feat(ai): connect AI providers once and choose one per job AI Services now keeps a provider registry (ai.providers, encrypted). Text and speech-to-text each select a provider by id and keep their own model settings; the ChatGPT plan stays a text-only choice through ai.auth_mode. New acting-administrator operations list, create, edit, delete, check, and list models for providers. Stored keys go only to the address saved with them, and a provider a job uses cannot be removed. On first start the server moves ai.base_url/api_key (and the subtitle_ai predecessors) and ai.asr_base_url/asr_api_key into providers, binding each job to the endpoint and key it used. The old rows stay in place unread. Transcription no longer falls back to the text endpoint. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(ai): keep a separate speech key when converting a shared endpoint A server that saved a speech key without a speech URL sent audio to the text endpoint with that key. The conversion now gives that endpoint and key a provider of its own instead of binding speech to the text key. Record the rejected v1 writes of the retired AI endpoint settings in the pre-lock removals table. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(ai): validate converted providers and refresh provider use after saves Conversion now runs each adopted provider through the same validation as an admin write, clamping names derived from long hosts, so an address the AI clients never accepted (a query string, credentials in the URL) leaves the job unconfigured instead of storing an entry that blocks every later provider edit. AI Services refetches the provider list after a save, so "used by" follows the job choices at once, and the transcription error hint names the speech-to-text provider instead of the retired base URL. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(ai): convert a speech key saved without any text endpoint Speech resolved its endpoint and key independently of text, so a server that stored only ai.asr_api_key transcribed against the default OpenAI endpoint with it, even when a ChatGPT plan served text. The conversion now resolves that fallback on its own instead of requiring a text provider. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(web): let text and speech-to-text choose no provider A job could switch providers but not release one, so an unused provider stayed in use and could not be removed. Each provider select now offers None, which saves an empty binding. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(ai): save None for the text model and normalize converted text URLs Choosing None for the text model now saves while subtitle and description translation are off; with either on, Save asks to turn them off first. The conversion trims a trailing slash from the stored text URL before deciding whether that endpoint also served speech, so https://api.openai.com/ keeps its speech binding. Co-Authored-By: Claude Opus 5.5 <[email protected]> * chore(apiv2): drop the approvals #3050 already used Their breaking changes are on main, so the contract check reports them as stale and fails every pull request that changes the v2 document. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(apiv2): declare every AI job in the provider used_by enum The embedding job joins in the stacked follow-up; declaring it with the new operations avoids a later response-enum addition, which the contract check treats as breaking. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(ai): recognize an API version only as a whole path segment Clients added /v1 to a base URL unless it contained the substring /v1, so a host such as v1-embed.internal or a path such as /proxy/v1-router lost its version. llm.HasAPIVersion now checks path segments (v1, v2, v1beta), and the chat client and the provider conversion share it. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(ai): validate provider bindings on single-setting writes PUT /admin/settings/{key} stored any provider id for a job, so a missing or unsuitable provider silently disabled the job and blocked later provider edits. It now runs the same registry check as the batch write. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(ai): warn about stored endpoints the conversion cannot keep A legacy AI endpoint whose URL carries credentials or a query is refused by the registry, so its job stays unconfigured. The conversion now reports the setting, startup logs a warning naming it (never the URL), and the admin settings doc says HTTP Basic authentication through the URL is unsupported. Co-Authored-By: Claude Opus 5.5 <[email protected]> * feat(ai): let OpenRouter serve embeddings OpenRouter serves embedding models such as google/gemini-embedding-001 at /api/v1/embeddings, so the type now declares embeddings alongside chat and speech. A known type's capabilities are applied when the registry is read, so OpenRouter providers saved earlier can be chosen for embeddings too. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(ai): name the setting that supplied a refused endpoint When only subtitle_ai.base_url held a URL the registry refuses, the startup warning named ai.base_url, which was empty. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
…3088) * feat(artwork): upload posters, backdrops and logos as local artwork Edit metadata > Images now has an Upload button on each tab. A movie or series takes a poster, backdrop or logo, and a season takes a poster. The upload goes through POST /api/v2/admin/items/{id}/images/upload, a multipart form with the slot and a JPEG, PNG or WebP file of at most 10 MiB. Silo never writes into library folders, which are mounted read-only, so the image is stored in artwork storage under the item's local/ keys and published like an applied image, with the images lock. Its source is upload://sha256:<hex>, a scheme image caching, reconcile and the ladder backfill already treat as not downloadable. The image list offers the upload as a local choice, marked current, while the item shows it. Applying another image replaces it, and revision GC collects it like any displaced revision, so no new table is needed. Huma validates multipart text fields at form.<name>; problems now report them under body.<name>, as they already did for file parts. * test(artwork): keep one upload test case per branch * style(web): format the image upload API test * fix(artwork): show why an image was refused and keep a shown revision - The Images tab toasts a validation problem's field detail, such as "The file is not a JPEG, PNG or WebP image", for both upload and apply, instead of the generic "did not pass validation" summary. - When publishing fails, the handler no longer queues for cleanup a revision the target already shows (a re-applied upload, or the same bytes uploaded again). The collector would have kept it anyway, since it checks references, but it no longer has to. - The handler takes its artwork publisher as an interface, so the upload and re-apply tests now check what gets published: the upload:// source, the images lock, and a season published with its series as parent. * perf(artwork): resolve uploads' display URLs in the list's batch call The image list resolved each shown upload's stored path with its own lookup after already batch-resolving the provider choices. It now adds the stored paths to that batch. * fix(artwork): queue unpublished artwork cleanup after a cancelled request When publishing a chosen or uploaded image failed because the request was cancelled, the cleanup call inherited the cancelled context. It now runs on a detached context bounded to 30 seconds. * chore(artwork): fix lint and add the upload route to the media manifest Group the huma import with third-party packages, reword comments and test messages the spelling linter flags, and record the new upload route in the media route manifest. * fix(artwork): accept untyped image parts and close the upload A browser that cannot name a file's type, such as a JPEG saved without an extension, sends it as application/octet-stream. The web check refused it and so did the form's part type, although the server checks the image's bytes. Both now let it through to that check. The handler also closes the uploaded part. * chore(api): clear the stale #3050 breaking-change approvals The contract diff refuses approvals that match no change. Against current main, the two section-override approvals from #3050 match nothing, so the check fails for any branch from main until they are removed. * docs(api): say when an untyped image part is accepted Finish the image part's description: an application/octet-stream part is accepted when its bytes are a JPEG, PNG or WebP image. * fix(artwork): keep surviving uploads through a storage bulk reset A reconcile that finds most of storage missing resets cached artwork without checking each object, and clears every row whose source isn't a provider URL. That cleared uploaded images whose objects survived, and nothing can fetch an upload again. Bulk mode now leaves upload:// rows out of the blind clear and verifies each one, clearing it only when its object is gone, as it already does for collection uploads. Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(artwork): note that bulk reconcile verifies uploads Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(api): say which uploads a season lists, and when a damaged upload returns 500 Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Quick104 <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]>
…ion reads (#3055) * feat(sections): let clients cap row size on the aggregate section reads Home and library rows return up to 100 cards each, but the Apple and Android clients now show at most 20 per row and open the full section page from an "Explore all" card. They had no way to ask for fewer. listHomeSections and listLibrarySections take an optional item_limit (1 to 100). Each row's limit becomes the smaller of its own effective limit and item_limit, applied to the resolved rows before the fetch, so the hide-watched widening and the cross-row duplicate filter work from the capped size, and the per-row item_limit reports the capped value. total_count keeps its meaning. Without the parameter nothing changes, and the frozen /api/v1 reads are untouched. getHomeCapabilities gains section_item_limit_max (100), present whenever the home sections service is configured, so clients send item_limit only to servers that accept it. Co-Authored-By: Claude Opus 5.5 <[email protected]> * chore(apiv2): prune the breaking-change approvals #3050 carried They matched #3050's diff and match nothing against the new base, which the contract gate reports as stale. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
…ients card Review fixes: - Keep an untouched quota bucket for seven days in memory and Redis instead of until the last request's rate would have refilled it, so lowering the rate cannot hand a drained session a fresh burst. - Refresh the Busiest API clients card with the rest of the dashboard. - Keep the sign-out dialog open until the request settles, so a failure shows its error. - Derive the web session quota type from the generated v2 schema, and add api_clients to the capability example in docs/admin-api.md. - Drop the two approvals #3050 left in breaking-approvals.json; the base already contains the changes they approve. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ients card Review fixes: - Keep an untouched quota bucket for seven days in memory and Redis instead of until the last request's rate would have refilled it, so lowering the rate cannot hand a drained session a fresh burst. - Refresh the Busiest API clients card with the rest of the dashboard. - Keep the sign-out dialog open until the request settles, so a failure shows its error. - Derive the web session quota type from the generated v2 schema, and add api_clients to the capability example in docs/admin-api.md. - Drop the two approvals #3050 left in breaking-approvals.json; the base already contains the changes they approve. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…an API clients card (#3075) * feat(ratelimit): add an hourly request quota per sign-in session The per-second and per-minute limits stop bursts but not volume: a client that stays just under them can send hundreds of thousands of API requests a day. Each sign-in session now also spends a token bucket (10,000 requests an hour, 30,000 burst) with off, log, and enforce modes; log is the default. Media transfer routes, admins, impersonating admins, and API keys are not counted. Admins get a Busiest API clients dashboard card, backed by hourly summaries of the activity log, that shows which sessions make the most requests, the routes they call, and lets an admin sign one session out. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(ratelimit): exempt playback calls and keep v1 frozen in the session quota Review fixes for the session quota and API clients summary: - Exempt everything under /stream and /playback, so a player keeps reporting progress, replanning and stopping after its session runs out, and anchor the direct-download exemption so POST /direct-download/links is counted. - Share the window limiter's Redis outage pause instead of keeping a second one, and drop refilled memory buckets inline instead of in a goroutine that was never stopped. - Leave session_quota out of the frozen /api/v1 rate-limit config. - Summarize UTC hours whatever the database time zone, redo the previous hour on each pass to pick up rows the activity log writes late, and leave out admins and impersonation as the quota does. - Cap one session's endpoint read at 24 hours. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(ratelimit): keep idle quota buckets a week and refresh the API clients card Review fixes: - Keep an untouched quota bucket for seven days in memory and Redis instead of until the last request's rate would have refilled it, so lowering the rate cannot hand a drained session a fresh burst. - Refresh the Busiest API clients card with the rest of the dashboard. - Keep the sign-out dialog open until the request settles, so a failure shows its error. - Derive the web session quota type from the generated v2 schema, and add api_clients to the capability example in docs/admin-api.md. - Drop the two approvals #3050 left in breaking-approvals.json; the base already contains the changes they approve. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(ratelimit): require a session quota to refill within a week An idle quota bucket is dropped after a week, so a quota that takes longer than that to refill from empty would get a fresh burst back early. The admin settings now reject a burst larger than 168 times the hourly rate. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(ratelimit): lock the usage summary, widen short card windows, and let a spent session sign out - Take a cluster advisory lock in the API usage summary task, so servers don't run overlapping scans and upserts of the same hours. - Read a card window from the start of the hour it begins in, so the one-hour range isn't empty while the current hour is being summarized, and read one session's routes over exactly the requested hours. - Treat a summarized hour ahead of this server's clock as the current hour instead of rescanning the 48-hour catch-up window. - Leave POST /auth/logout and GET /auth/provider-logout out of the session quota, so an exhausted session can still end itself. - Show an idle session's routes as empty rather than a load error. - Document session_quota in the admin rate-limit config section. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(web): keep the API client routes query typed when a 404 becomes an empty list The hand-built empty result didn't carry the v2 contract brand, so the web build failed type-checking. Return only the endpoints the card reads. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(apiusage): take the summary lock on the connection that runs the pass The task held a session advisory lock on one pooled connection while the summary and prune statements asked the pool for another. With database.max_connections at 1 the startup pass waited on itself and held the only connection. Refresh now takes a transaction-scoped lock and runs both statements in that transaction, and skips the pass when another server holds the lock. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(ratelimit): drop a session's quota bucket once any allowed rate would have refilled it Every bucket was kept a week after its last request, so a signed-in user who kept signing in again grew the in-process map (and Redis) by one bucket per session for a week. A bucket now goes after the share of a week it is missing: the admin settings require any rate to refill a full burst within a week, so by then any allowed rate has refilled it and dropping it grants nothing. A drained bucket is still kept a week, so lowering the rate can't hand it a fresh burst; one a client barely touched goes within seconds. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Claude Opus 5.5 <[email protected]>
…ons and history (#3108) * fix(audiobooks): measure Audiobookshelf plays against the whole book in admin history An Audiobookshelf play mirrors into a native playback session started on the book's first file, while its syncs report the position in the whole book. Admin Playback History took the first file's length as the duration, so a multi-file book was marked completed once the listener passed the end of the first track. The ABS play start now records the book's total length on the session, and the history row uses it. Closes #3098 Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(audiobooks): apply the final sync an Audiobookshelf session close carries Audiobookshelf clients send their last position and listening time in the body of POST /session/{sid}/close, and Audiobookshelf applies it as a final sync before closing. Silo ignored the body, so everything after the last periodic sync was lost from the resume position, the session's listening time and the admin Playback History row written at close. A close with a body now applies it like a sync first; an empty body still closes without one. Closes #3099 Co-Authored-By: Claude Opus 5.5 <[email protected]> * refactor(audiobooks): flatten the Audiobookshelf close final-sync check Co-Authored-By: Claude Opus 5.5 <[email protected]> * feat(audiobooks): track Audiobookshelf plays that clients report only through local sessions Some Audiobookshelf clients, Plappa and Prologue on iOS among them, never open a session with /play. They stream the files directly and post their local session to /session/local or /session/local-all every few seconds while playing. Silo kept the resume position from those posts, but the play never appeared in admin live sessions or Playback History. A local session updated within the last two minutes is now mirrored into a native playback session, as a /play session is. Its ID is derived from the account, profile and client session ID, so every report of one play reaches the same session and history row. It carries the book's length and the client name from deviceInfo. These clients send no stop, so the session takes its own 90-second idle window: the play ends 90 seconds after the last report. Older reports (offline listening synced late, or an old session sent again) still only move the resume position. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(audiobooks): count the listening time Audiobookshelf syncs report, and name their clients An Audiobookshelf session sync carries timeListened, the seconds played since the previous sync. Admin watch time instead inferred playing from how far the position moved, which drops a whole sync interval whenever it contains a seek and the first interval when a client resumes from its own saved position. With AudioBooth, a 2.5-minute listen around a scrub was recorded as 1:43. A sync's timeListened is now credited directly, capped at the time that actually passed so a client cannot claim more. Sessions started with /play were also all named "Audiobookshelf". The deviceInfo clients send in the /play body now names them, as it already does for local sessions. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(audiobooks): count the listening before a local session's first report A play reported only through /session/local was measured from its first report, so the stretch before it (ten seconds with Plappa) was never counted. The native session now starts measuring at the startTime and startedAt the client reports, and the usual seek check still decides whether that stretch was played. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(playback): show a multi-file audiobook's length in admin live sessions The live sessions view measured an Audiobookshelf play's whole-book position against the session's first file, so a book whose first track is 44 seconds showed 57:09 / 0:43. The session's timeline length now syncs to playback_sessions_sync, and the view uses it in place of the file's duration when it is set. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(audiobooks): harden Audiobookshelf play tracking after review - Local-session plays credit the change in the client's running listening total, capped at the time that passed, instead of inferring it from position. Listening above 2x speed now counts. - A play is measured from the client's start only when it began moments ago. A session rebuilt for an older play takes the client's total as its baseline, so a later skip is not credited. - Local-session plays are report-only and never count toward stream limits: the client may be playing a downloaded copy. - A close's final sync is best effort, so a body that cannot be read or a sync that fails still closes the session; a session already closed applies no final sync. - A local-all batch syncs the admin views once, deviceInfo without a version keeps the header's version, and the book-length sum is shared. Co-Authored-By: Claude Opus 5.5 <[email protected]> * docs(apiv2): say what a live session's file_duration measures file_duration is the length position_seconds is measured against. For a multi-file Audiobookshelf book that is now the whole book rather than the session's first file, so the field's description says so. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(audiobooks): address the second review of Audiobookshelf play tracking - A local session that reports no listening total is measured from its position again, instead of counting nothing. - Only the highest listening total a session has seen is its baseline, so a late or repeated report cannot count the same listening twice. - A close body without a currentTime ({}, null) is no final sync rather than a sync to position 0. - A final sync that fails on the session row still writes the resume position and the native session's position. - When deviceInfo names the client, the version comes only from it. - A live report looks its session up once, and whether it started one is returned beside the ABS result instead of stored on it. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(audiobooks): address review of Audiobookshelf play tracking on #3108 - Keep the frozen /api/v1 session file_duration as the file's duration; only the v2 session reads report the whole book's length. - Cap the reported plays one account can have live at ten. They are outside stream limits, so nothing else bounded them. - Close an Audiobookshelf session and apply its final sync in one statement that reports whether this request closed it. Of concurrent or repeated closes only that one updates the resume position, the native session and other clients. - Measure a new reported play from where and when the client says it began even when it reports no listening total. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(audiobooks): address the second review round on #3108 - A sync whose session row fails to save writes nothing else: the client gets an error and syncs again, and the retry would count the same listening twice. - A sync's or close's listening time is bounded to [0, 1 day] before it is added to the session's stored total. - Remove the breaking-change approvals #3050 added; they match no change now that #3050 is in main. Co-Authored-By: Claude Opus 5.5 <[email protected]> * fix(audiobooks): keep the book length, final sync and listening on a multi-server close On more than one API server, Audiobookshelf plays lost what this branch records: - A close that reaches a server without the native session records the play through FinishDetached, which read neither the book length synced to playback_sessions_sync nor the close's final sync. LiveSession now reads timeline_duration_seconds, the detached snapshot takes it, and the close applies its accepted final sync to the row it hands to the stop. - A /play sync credited only its own timeListened, so a sync handled elsewhere lost its listening. Syncs now pass the row's running total to UpdateProgressReported, which credits how far it rose since the last total the session saw; UpdateProgressListened goes. A report that does not raise the total no longer moves the listening baseline, so a delayed lower total cannot shrink the next rise's cap. The AdminPlaybackSessionView doc comment is back on the alias. Co-Authored-By: Claude Opus 5.5 <[email protected]> * refactor(audiobooks): leave tracking of local-session-only plays to a follow-up Plays that clients report only through /session/local were mirrored into report-only native sessions held in one server's memory, outside the playback lifecycle every other play uses. A play resumed after its idle expiry reused an ID whose lifecycle row was already stopped, so Activity hid it for up to 25 hours; a server that died mid-play lost its history row; and servers could hold competing copies of one play. This removes that tracking (ReportOnly, IdleGrace, RegisterReportOnly and the /session/local mirroring) so the whole-book length, the close's final sync and the reported listening time can land on their own. Local sessions move the resume position, as before. A follow-up rebuilds the tracking on the lifecycle path. Co-Authored-By: Claude Opus 5.5 <[email protected]> --------- Co-authored-by: Brady3035 <[email protected]> Co-authored-by: Claude Opus 5.5 <[email protected]> Co-authored-by: Quick104 <[email protected]>
Problem
Related issue: N/A
Validation tasks: none
Any profile could save a Home or library row with an item limit of a billion. Every page load for that profile then reserved memory for that many items and could crash the server. Admin sections were already capped at 500; profile overrides were not. This change applies the same cap to profile overrides, both when they are saved and when stored rows are read.
The profile override's
item_limithad onlyminimum: 1. v1PUT /profile/sectionsand v2replaceProfileSectionOverrides/replaceAdminUserProfileSectionOverridesall go throughsaveProfileOverrides, so any signed-in profile could store an arbitrary value. The section fetchers size slices and maps from the resolved limit before any query runs.Approach
sections.MaxItemLimit(500) is the single cap for admin sections and profile overrides.saveProfileOverridesrefuses a larger value with 400invalid_item_limiton v1. The v2SectionOverrideWrite.item_limitschema now hasmaximum: 500, so v2 rejects it as avalidation_failedproblem before the handler runs.GET /profile/sectionsand the v2 list operations) also reports a stored value above 500 as 500. The web Home Screen editor sends back the saveditem_limitof every row it did not touch. Without this, one oversized row stored before the cap would make every later save of that page fail.maximumon a request field as breaking, so both replace operations are recorded incontracts/api/v2/breaking-approvals.jsonwith this PR. A request that used to be accepted now fails./api/v2is not locked yet, and no client sends values that large in normal use.Rejecting a value above 500 on save, rather than quietly lowering it, matches how the v2 admin section operations already treat the same field.
This addresses CodeQL alerts #160, #161 and #162 (
go/uncontrolled-allocation-sizeininternal/sections/fetcher.go).Client and jellycompat impact: silo-apple and silo-android never write section overrides, so neither needs a change. The web row editor offers at most 100. jellycompat builds its own rows with fixed or capped limits and never reads profile overrides, so it needs no matching change.
Validation
internal/sections,internal/api/handlersandinternal/apiv2: pass. New tests cover the save-time refusal, the cap on every resolve path, and a stored oversized row that lists at 500 and saves back cleanly.make lint-changed: 0 issues.make verify-apiv2-contract: pass. Two changes, both approved.make verify-settings-bindings-allwas not run (no web toolchain in the test environment).make test-go: passes exceptTestPlaybackInfoWithoutStripOrToneMapStillHasNoRouteandTestPlaybackInfoSkipsStripWhenRPUCannotBeStrippedin jellycompat, which fail the same way onmain.Evidence
Evidence: https://evidence.siloserver.org/r/silo-server/pr-3050/
Risks
Checklist
AI Disclosure
ItemLimitfrom the resolver through the fetchers, the watched-item widening, Explore's wide fetch and jellycompat, and checked the web editor, the layout export and import, and both native clients for override writes. One finding: the override list endpoints still returned stored values above 500, which the web editor sends back on save, so a profile with an old oversized row could no longer save that page. Fixed by reporting stored values at the cap when listing, with a test that fails without the fix. No other findings.🤖 Generated with Claude Code