Skip to content

Keep the pathways editor working with Rapid 3.0.0-pre.4 - #198

Merged
jeffmaki merged 1 commit into
developfrom
fix/rapid-3-pre4
Dec 1, 2026
Merged

jeffmaki merged 1 commit into
developfrom
fix/rapid-3-pre4

Conversation

@jeffmaki

@jeffmaki jeffmaki commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

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.local is gone. In pre.4 ("Graph step 3: per-graph records in a persistent vector"), a graph's own edits come from graph.localEntities(). graphEntities() read graph.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-osm is gone. pre.4 has one select mode 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 logged context.enter: no such mode: select-osm and did nothing.

Changes

  • graphEntities() uses graph.localEntities() when the graph has it, and graph.local.entities otherwise.
  • The level tools select through one helper. It uses select-osm when Rapid has that mode (pre.3), and select with entity IDs otherwise (pre.4).

graphStamp(), which decides when the validators' cached indexes are stale, needs no change: in pre.4 a graph's key includes a version that every edit bumps.

Testing

  • Against the real deployed Rapid builds. I opened a pathways workspace in Rapid 3 in a local harness that loads the actual stage (pre.4) and prod (pre.3) builds, and serves a small station from a stubbed OSM API.
    • Before this change, pre.4 failed to start the editor.
    • With it, on both builds, the editor starts and the Stations panel lists the levels.
    • Selecting the station opens its editor, and switching levels, expanding stops, zooming, refitting and undoing all run with no errors.
  • Unit tests. New tests for pre.4 cover startup, graphEntities with localEntities(), 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, and edit.spec.ts passes.

Deploying

  • Dev and stage are on Rapid pre.4, so their pathways editor stays broken until this reaches them.
  • Prod's Rapid should stay on pre.3 until this reaches the prod frontend.

🤖 Generated with Claude Code

  • services/rapid3-levels.ts: graphEntities uses graph.localEntities() when available. Otherwise it uses graph.local.entities.
  • services/rapid3-levels.ts: Level-outline and feature selection call a new #selectEntities method. It uses select-osm with OSM IDs when available. Otherwise it uses select with entity IDs.
  • test/unit/services/rapid3-levels.test.ts: Adds a fakePre4Context and pre.4 tests for level listing, graph entities, and selection.

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>
@coderabbitai

coderabbitai Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The service now supports Rapid 3.0.0-pre.4 graph-local entity access and unified selection, while retaining compatibility with earlier API shapes. Tests cover level listing, graph entity enumeration, and entity selection.

Changes: Rapid 3 API Compatibility

Layer / File(s) Summary
Graph and selection API compatibility
services/rapid3-levels.ts, test/unit/services/rapid3-levels.test.ts
graphEntities reads local edits from localEntities() when available and falls back to graph.local.entities. Entity selection uses select-osm when available and otherwise enters select with entity IDs. Tests cover the pre.4 context and these behaviors.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: bhousel

Merge Risk: Minimal · up to 5ccb5

The change restores the pathways editor on Rapid pre.4 and keeps the pre.3 behavior that prod still runs. No concrete defect was found. One open question is whether validation results refresh after a local edit on pre.4, since the Rapid source could not be inspected. It is worth a quick manual check on the stage build.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title names the main change: keeping the pathways editor working on Rapid 3.0.0-pre.4. The raw summary and objectives confirm the change adds pre.4 APIs (localEntities() and unified select mode) w…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: keeping the pathways editor working on Rapid 3.0.0-pre.4. The raw summary and objectives confirm the change adds pre.4 APIs (localEntities() and unified select mode) with a fallback to pre.3 behavior. The title is specific and matches the changeset.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

A rabbit checks the graph at dawn
Local edits appear, deletions gone
The levels line up neat and clear
Selection finds the features near
Two API paths now share one tune
The rabbit hops beneath the moon

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2c1a247c-2312-436c-99c6-ad15d2f44e2b
Commits

Reviewing files that changed from the base of the PR and between 7bf483e and 5ccb5ea.

Files selected for processing: 2

  • services/rapid3-levels.ts
  • test/unit/services/rapid3-levels.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.

@jeffmaki
jeffmaki merged commit 047f8c4 into develop Dec 1, 2026
2 checks passed
@jeffmaki
jeffmaki deleted the fix/rapid-3-pre4 branch December 1, 2026 22:09
jeffmaki added a commit that referenced this pull request Dec 1, 2026
…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)
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