Repository navigation
Keep the pathways editor working with Rapid 3.0.0-pre.4 - #198
Conversation
Rapid 3.0.0-pre.4 stopped the pathways editor from starting: - Its graphs no longer have `local`; their own edits come from `localEntities()`. `graphEntities` read `graph.local.entities`, so the level tools threw on start and every GTFS validator failed. - It selects any data with one `select` mode taking data IDs, so `select-osm` is gone and selecting a station, stop or level outline did nothing. Both now use the pre.4 way when it's there and the old one otherwise, since prod still runs pre.3. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
…203) Cherry-pick of #198, which merged to `develop`, so stage gets the fix without waiting for the next dev-to-stage merge. ## Why Stage runs Rapid 3.0.0-pre.4, and its pathways editor shows "The editor couldn't start" when a pathways workspace is opened in Rapid 3. #198 fixes the two pre.4 changes that broke it, and keeps pre.3, which prod still runs, working. See #198 for the cause and the full description. ## What's here One commit, `git cherry-pick -x 5ccb5ea`. It applied cleanly: `services/rapid3-levels.ts` and its test file were identical on `staging` and on `develop` before the fix. The last dev-to-stage merge (#200, 11/30) predates #198. ## Tested on this branch - `test/unit/services/rapid3-levels.test.ts`: 76 passed. With `rapid3-levels.ts` reverted to `staging`'s version, the 3 new pre.4 tests fail and the other 73 pass. - Full unit suite: 71 files, 805 tests passed. **Unrelated note:** `npm ci` fails on `staging` because its `package-lock.json` is out of sync with `package.json` ("Missing: crossws@0.4.17 from lock file"). I installed with `npm install` to run the tests and didn't commit the lockfile it rewrote. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Summary
Since Rapid 3.0.0-pre.4 was deployed to dev and stage, opening a pathways workspace in Rapid 3 shows "The editor couldn't start." This fixes the two changes in pre.4 that broke it, and keeps everything working on pre.3, which prod still runs.
Cause
graph.localis gone. In pre.4 ("Graph step 3: per-graph records in a persistent vector"), a graph's own edits come fromgraph.localEntities().graphEntities()readgraph.local.entities, so the level tools threw on start (Cannot read properties of undefined (reading 'entities')), and every GTFS validator failed on every feature.select-osmis gone. pre.4 has oneselectmode for any data ("Data IDs step 4"), taking{ selection: [dataID, ...] }, where an OSM feature's data ID is its entity ID. Selecting a station, stop or level outline from the Stations panel loggedcontext.enter: no such mode: select-osmand did nothing.Changes
graphEntities()usesgraph.localEntities()when the graph has it, andgraph.local.entitiesotherwise.select-osmwhen Rapid has that mode (pre.3), andselectwith entity IDs otherwise (pre.4).graphStamp(), which decides when the validators' cached indexes are stale, needs no change: in pre.4 a graph'skeyincludes a version that every edit bumps.Testing
graphEntitieswithlocalEntities(), and selection; they fail without this change. The existing tests keep the pre.3 shape. The full suite passes (803 tests), lint and typecheck are clean, andedit.spec.tspasses.Deploying
🤖 Generated with Claude Code
services/rapid3-levels.ts:graphEntitiesusesgraph.localEntities()when available. Otherwise it usesgraph.local.entities.services/rapid3-levels.ts: Level-outline and feature selection call a new#selectEntitiesmethod. It usesselect-osmwith OSM IDs when available. Otherwise it usesselectwith entity IDs.test/unit/services/rapid3-levels.test.ts: Adds afakePre4Contextand pre.4 tests for level listing, graph entities, and selection.