Repository navigation
fix(astro-web): page PostgREST reads and keep tracked services at 999 (RH-07bc) - #106
Merged
Merged
Conversation
Sitemap, category, and evidence reads stopped at the PostgREST 1000-row cap, and evidence filters queried a column that does not exist. The leaderboard headline now uses the public API total and refuses 1000 and 1048. Co-authored-by: tomdmeredith <tomdmeredith@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
tomdmeredith
marked this pull request as ready for review
October 6, 2026 16:41
The public-truth job failed because Vitest imported astro-web TypeScript and then could not resolve astro/tsconfigs/strict. Those tests now run with Node's test runner in the astro-web job. Co-authored-by: tomdmeredith <tomdmeredith@users.noreply.github.com>
This branch was successfully 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.
RH-07bc
Tom Meredith greened this for merge on 2026-10-06, about 9:30 AM PT. Bug fix on the live Astro site (
vercel.jsonbuildspackages/astro-web). Not merged here.Do not merge until this proof is read.
Public integers stay 999 services · 435 capabilities · 28 callable · 87 categories. The leaderboard headline cannot show 1000 (PostgREST max-rows cap) or 1048 (paged
scores/servicestable size).Production path is
packages/astro-web/src/lib/api.ts.packages/web/lib/api.tsis the legacy Next app and is not the rhumb.dev build, so this change does not touch it.What changed
supabaseFetchAllpages PostgREST withlimit/offsetuntil an empty page (50-page guard) for sitemap services, category counts, the unknown-category leaderboard error list, and evidence list reads.source_type(runtime_verified,tester_generated).evidence_recordshas noevidence_typecolumn (packages/api/migrations/0011_review_evidence.sql), so the old filter 400'd and every service showed zero runtime evidence.getServiceCount()readsGET /v1/services?limit=1data.totalfirst. A pagedscoresread remains only as a fallback, anddisplayedServiceCount()refuses 1000 and 1048. The leaderboard hub no longer falls back to the sum of Supabase category counts.Proof
Paging past 1000.
collectPagedRowsis whatsupabaseFetchAllcalls. The unit test feeds a 1000-row page, then a 48-row page, then an empty page, and asserts the calls arelimit=1000&offset=0,offset=1000,offset=2000and that 1048 rows are collected. That collected size is then passed throughdisplayedServiceCount, which returns 999.Count path = API 999. Happy path is
getServiceCount→getServiceCountFromAPI()→GET /v1/services?limit=1data.total. Live read on 2026-10-06:GET /v1/services?limit=1data.total999GET /v1/capabilities?limit=1data.total435GET /v1/proxy/statsservices_callable28GET /v1/leaderboardThe public leaderboard category
service_countvalues sum to 959, not 999. The old hub fallback (categoryServicesTotal) would have shown that sum, or ~1048 after paging the Supabaseservicestable. Both are removed. If the API total is missing, 1000, or 1048, the headline falls back to the committed public catalog (999).source_type. Both evidence queries aresource_type=in.(runtime_verified,tester_generated)with a stableidorder, and they go throughsupabaseFetchAll. The RH-07c note expected this to move services off "Assessed" under the existing tier rules (Tested at ≥1 runtime/tester row, Verified at ≥50). This PR does not change those thresholds and did not re-query Supabase.Tests
The first public-truth run failed because
packages/webVitest importedpackages/astro-web/src/lib/public-catalog.ts. Vitest then loadedpackages/astro-web/tsconfig.json, whichextendsastro/tsconfigs/strict, and that package is not installed in the web job (TSConfckParseError).Those tests no longer live in
packages/web.packages/astro-webruns them with Node's test runner (npm test→node --experimental-strip-types --test tests/public-catalog.test.ts) in theastro-web-buildjob, which already installs Astro on Node 24.public-catalog.tsdoes not import other Astro modules, so the runner does not need that tsconfig. The web job is back to its previous three contract files and does not import astro-web TypeScript.Locally: Node 22 and Node 24.21 both passed the 5 catalog tests. The three public-truth Vitest files passed (36 tests).
Out of scope
RH-09, RH-10, GSC resubmit, tickets #95–#105, #59, launch/GA, paid execute, and RH-07d link columns (
base_url/docs_urlonservices).