Skip to content

Enforce MAX_BULK_CACHED_SKELETONS limit at the API layer#11

Merged
fcollman merged 2 commits intobulk_skeleton_improvementsfrom
copilot/sub-pr-7-again
Mar 18, 2026
Merged

Enforce MAX_BULK_CACHED_SKELETONS limit at the API layer#11
fcollman merged 2 commits intobulk_skeleton_improvementsfrom
copilot/sub-pr-7-again

Conversation

Copy link

Copilot AI commented Mar 18, 2026

MAX_BULK_CACHED_SKELETONS was imported in api.py but only referenced in a docstring — the actual enforcement (silent truncation) happened deep in the service layer, invisible to callers.

Changes

  • API-layer validation: SkeletonResource__get_cached_skeletons_bulk.post() now checks len(rids) against MAX_BULK_CACHED_SKELETONS and returns 400 immediately if exceeded, rather than silently truncating in the service layer.
if len(rids) > MAX_BULK_CACHED_SKELETONS:
    return {"Error": f"Too many root IDs requested: {len(rids)}. Maximum allowed is {MAX_BULK_CACHED_SKELETONS}."}, 400

Clients now get an explicit error instead of receiving a silently truncated result set.


📱 Kick off Copilot coding agent tasks wherever you are with GitHub Mobile, available on iOS and Android.

Co-authored-by: fcollman <782341+fcollman@users.noreply.github.com>
Copilot AI changed the title [WIP] [WIP] Address feedback by enforcing server-side limit for bulk endpoints and auth token Enforce MAX_BULK_CACHED_SKELETONS limit at the API layer Mar 18, 2026
Copilot AI requested a review from fcollman March 18, 2026 09:57
@fcollman fcollman marked this pull request as ready for review March 18, 2026 09:58
@fcollman fcollman merged commit 87608b0 into bulk_skeleton_improvements Mar 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants