Repository navigation
fix(api): detail endpoint returns participants + latest_version (#853) - #856
Merged
Merged
Conversation
GET /datasets/:id did SELECT d.*, exposing the raw subject_count column but not the participants alias, and no latest_version (that is a computed subquery, not a table column). The list + search endpoints both return participants + latest_version, so search-card hydration that rehydrates via the detail endpoint lost the subject count. Add both alongside d.* (additive; raw columns untouched, so no contract regression). Closes #853.
📦 Package PreviewYour package is ready to test! bun install -g nemar-cli@PR856Version: 🤖 Updated on each push. |
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
GET /datasets/:iddidSELECT d.*, which exposes the rawsubject_countcolumn but not theparticipantsalias the list/search endpoints return, and nolatest_version(a computed subquery, not a table column). This adds both to the detail projection alongsided.*.Why
The website's Discover search results hydrate each hit through
/datasets/:idto pick up description/size/citations, but the detail row'sparticipants: nulloverwrote the good value from the search projection, so search-result cards rendered no subject count (HBN / face-processing datasets, etc.). The frontend shipped abackfillSearchHitstopgap; this is the root-cause fix on the contract side. Once this lands, that stopgap can be removed.Contract safety (no regression)
d.*is untouched, so every existing field (including the rawsubject_count) is unchanged. Two new fields are added:participants,latest_version.participantsorlatest_versionraw column exists ondatasets(verified across migrations:subject_countadded in 0020;latest_versionlives only on the deprecatednemar_catalogtable), so there is nod.*name collision.Testing
bun run typecheck(root + backend) green.bun testdatasets route units: 68 pass / 0 fail (unchanged fromdev).api-testsuite, per the repo's no-mock / no-fabricated-D1-data policy (cf.test/data-records-route.test.ts). Spot-check after deploy:Closes #853.