Skip to content

Fix Canvas and UMAP run page reading each other's points - #367

Merged
byronwall merged 2 commits into
mainfrom
claude/umap-points-one-query
Nov 28, 2026
Merged

byronwall merged 2 commits into
mainfrom
claude/umap-points-one-query

Conversation

@byronwall

@byronwall byronwall commented Nov 28, 2026 •

Copy link
Copy Markdown
Owner

Moving between Canvas and a UMAP run page no longer breaks either one. Both now read points through one query.

Before: The fault reproduced. Opening Canvas after a run page showed "Something went wrong: points is not iterable". Opening a run page from Canvas showed "0 points".
After: Canvas draws its regions and the run page shows all its points, in both directions and after Back.

Cause

fetchUmapPoints and fetchUmapPointsForRun both registered the query name umap-points. The router caches by name and arguments, so one page got the other page's cached value in the wrong shape. This PR deletes fetchUmapPointsForRun.

Proof

Canvas then run page, before and after
Canvas, then the UMAP page, then the run: 0 points before, 12 points after.

Run page then Canvas, before and after
Run page, then Canvas: crash before, the region and its 12 notes after.

One browser script, run before and after the fix, on pnpm dev with an isolated audit database and one synthetic 12-point run:

Path (client-side navigation) Before After
Canvas → UMAP → run, at once 0 points 12 points
Run page → Canvas, at once crash region shown
Canvas → UMAP → run after 6s 12 points 12 points
…then, 6s later, Back twice to Canvas crash region shown

The new test tests/unit/query-keys.test.ts fails when a query name under src/ repeats, or when it cannot read a router query registration. On the old sources it fails with:

"umap-points: services/umap.service.ts, services/umap/umap.queries.ts"

pnpm lint exits 0 (warnings only), pnpm type-check passes, and pnpm test gives 925 passed, 86 skipped (database tests, no TEST_DATABASE_URL).

Codex review round 1 on the first commit passed (no P0 or P1 in scope). The second commit fixes its three in-scope findings: gaps in the new test, a dimensions badge that could keep the previous run's value, and a stale line in mcp-parity.md. Closing the review added the stricter test. No second round ran. After #361 and #362 merged, the branch was rebased on them. The conflicts were in detail-types.ts and the run page, and UmapPoint now comes from umap.queries.ts. Lint, type-check, tests and the browser script passed again on the rebased code. The screenshots are from before the rebase.

Limits

  • The browser check did not run against a production build.

Open findings

  • P1 · base · app/src/routes/umap/[id]/index.tsx:40 — "Refresh points" sends no server request, because the points query is called after an await and is not tracked. Pre-existing: same call order on main.

🤖 Generated with Claude Code

byronwall and others added 2 commits November 28, 2026 01:21
fetchUmapPoints and fetchUmapPointsForRun both registered "umap-points",
so Canvas and the run page read each other's cache entry with the wrong
shape. Canvas crashed and the run page showed no points. Delete the
second query and fail the tests on any repeated query name.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Fail the test on router imports and call shapes the scan cannot read.
Keep the run page's dimensions badge live, and drop the removed query
from the MCP parity matrix.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@byronwall
byronwall force-pushed the claude/umap-points-one-query branch from be35fdb to e222e32 Compare November 28, 2026 06:22
@byronwall
byronwall merged commit 108c499 into main Nov 28, 2026
4 checks passed
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