Skip to content

fix(studio): prevent silent domain query scope changes - #244

Merged
yordis merged 2 commits into
mainfrom
yordis/fix-studio-domain-query
Oct 25, 2026
Merged

yordis merged 2 commits into
mainfrom
yordis/fix-studio-domain-query

Conversation

@yordis

@yordis yordis commented Oct 25, 2026

Copy link
Copy Markdown
Member
  • Domain-scoped inspection must preserve the selected version and continuation scope instead of silently returning version 1 and the first page.
  • Malformed query values must be refused before they can change the requested inspection scope.

Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
@cursor

cursor Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

PR Summary

Low Risk
Read-only gateway validation and parameter forwarding; behavior for callers omitting query params stays at version 1 and latest-only, with stricter rejection of bad inputs before upstream RPC.

Overview
Studio’s GET /api/by-domain no longer hardcodes Domain version 1, latestVersionsOnly: true, and the first page. It now accepts version, latestVersionsOnly, pageSize, and pageToken (along with existing kinds), validates each as a single scalar with strict numeric/boolean rules, returns HTTP 400 before listEntitiesByDomain when input is malformed or repeated, and passes through entities / nextPageToken unchanged.

Reference docs add a Studio HTTP bridge section for this contract; the gateway README links to it. Bridge tests cover defaults, full forwarding (including large uint64 versions, branch header, and auth passthrough), and a broad invalid-query matrix.

Reviewed by Cursor Bugbot for commit 22c20f6. Bugbot is set up for automated code reviews on this repo. Configure here.

@coderabbitai

coderabbitai Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

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: a06e2ea8-ea2c-4a46-918c-898c6f278f26
Commits

Reviewing files that changed from the base of the PR and between f79e10f and 22c20f6.

Files selected for processing: 4
  • docs/reference/domain-scoped-listing.md
  • tsworkspace/webapps/studio/server/README.md
  • tsworkspace/webapps/studio/server/index.mjs
  • tsworkspace/webapps/studio/server/index.test.mjs

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 Studio by-domain route now accepts validated version and pagination controls and forwards them to ListEntitiesByDomain. Tests cover query validation, request forwarding, authorization, and response cursors. Documentation describes the route’s scope and behavior.

Changes

Studio by-domain listing

Layer / File(s) Summary
Validate and forward listing controls
tsworkspace/webapps/studio/server/index.mjs, tsworkspace/webapps/studio/server/index.test.mjs
The route validates version, latest-only, and pagination query values, then forwards them to the RPC. Tests cover defaults, exact version strings, accepted and rejected values, authorization, branch metadata, and response cursors.
Document route scope and controls
docs/reference/domain-scoped-listing.md, tsworkspace/webapps/studio/server/README.md
The documentation describes the route’s query controls, exact Domain version scope, response behavior, and the limits of the bridge and its tests.

Priority: Normal

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

Change: Bug fix

Possibly related PRs

  • TrogonStack/atlas#243: Defines the ListEntitiesByDomain contract that this bridge forwards requests to.

Suggested reviewers: enilsen16

Merge Risk: Minimal · up to 22c20

The domain-listing changes appear ready to merge after normal checks; no actionable merge-blocking risk was established.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title names the main change: domain-scoped query handling now keeps the selected version and pagination scope instead of silently changing them. It matches the summarized changes to /api/by-domain…
Description check Passed The description states two goals: keep the selected version and continuation scope instead of silently returning version 1 and the first page, and refuse malformed query values before they change the …
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 2 files. (2 skipped: 2 …
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.
Full details: Title check

Explanation

The title names the main change: domain-scoped query handling now keeps the selected version and pagination scope instead of silently changing them. It matches the summarized changes to /api/by-domain query validation and defaults, and the 'fix(studio)' prefix matches the scope of the change.

Full details: Description check

Explanation

The description states two goals: keep the selected version and continuation scope instead of silently returning version 1 and the first page, and refuse malformed query values before they change the inspection scope. Both goals match the summarized changes to the Studio server route and its tests.

Full details: Docstring Coverage

Explanation

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

Finishing Touches
📝 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

A rabbit checks the version string,
And sends the page token on its way.
The listing keeps its cursor safe,
While tests reject a crooked query.
Then hops away through fields of hay.

Comment @coderabbitai help to get the list of available commands.

Comment thread tsworkspace/webapps/studio/server/index.mjs Fixed
Comment thread tsworkspace/webapps/studio/server/index.mjs Fixed
Signed-off-by: Yordis Prieto <yordis.prieto@gmail.com>
@yordis
yordis merged commit 5199605 into main Oct 25, 2026
27 checks passed
@yordis
yordis deleted the yordis/fix-studio-domain-query branch October 25, 2026 14:36
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