Skip to content

Sanity: read datasets listed as elements named after them - #544

Merged
nambok merged 1 commit into
mainfrom
fix/sanity-dataset-reply
Nov 10, 2026
Merged

nambok merged 1 commit into
mainfrom
fix/sanity-dataset-reply

Conversation

@nambok

@nambok nambok commented Nov 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

Opening any Sanity project in the knowledge picker said "Sanity didn't list any datasets for project …". The logging added earlier showed Sanity's actual answer: a sentence, then XML where each dataset is an element named after it (<datasets><production><aclMode>public</aclMode>…</production></datasets>), with no name field. The dataset reader only took name fields or a datasets array, so it found none.

Changes

  • dataset_names reads a datasets object's keys as the dataset names (comment datasets still left out), alongside the shapes it already read.
  • Tests replay Sanity's answers in its own format: the dataset list through browse, and a GROQ query answered as <documents><document>{json}</document></documents>.

Verification

  • cargo test -p common -p gateway: 1634 and 798 passed. cargo clippy --all-targets -D warnings: clean.

Sanity's server answers list_datasets with a sentence and XML in which each dataset is an element named after it, with no name field. Every project's datasets read as none, so the picker said Sanity listed no datasets. The names are now read from those elements, and a query answer in Sanity's documents format is covered by a test.
@nambok
nambok merged commit a224b2f into main Nov 10, 2026
10 checks passed
@nambok
nambok deleted the fix/sanity-dataset-reply branch November 10, 2026 07:03
coderhelm Bot pushed a commit that referenced this pull request Dec 6, 2026
Moves dashboardRef to coderhelm main (e65ef06), which adds the Pull requests
page (#544), the follow-up on main (#545) and the pull requests overview
(#546). The API they read shipped in #985 and #988.
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.

1 participant