trails/apps/planner
Ullrich Schäfer e34a06ff5a
fix(planner): raise WS frame cap above doc cap (fixes sync reconnect loop)
The Yjs sync WebSocket had MAX_MESSAGE_BYTES = 256 KB (per frame) but
MAX_DOC_BYTES = 5 MB (per session doc). A full-state sync frame carries
the entire doc, so any session doc between 256 KB and 5 MB was allowed to
exist yet could never sync: the client's sync frame tripped the 256 KB
per-frame cap, the server closed it (1008), the client reconnected, resent
the same oversized frame, and looped forever — the UI froze, the connection
flapped Verbunden/Verbinde, and the network tab filled with 101 reconnects.

Real routes hit this fast because the BRouter geometry is stored in the doc:
a 4-waypoint, 77 km cycling route was already 305 KB.

Fix: the per-frame cap must be >= the doc cap (a full-doc sync must fit in
one frame). Set MAX_MESSAGE_BYTES = MAX_DOC_BYTES + 256 KB overhead; the
5 MB doc cap stays the real size/abuse guard. Updated the test that had
codified the inverted ordering.

Verified: planner typecheck + lint clean, yjs-server 9/9, planner suite
183/183.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-14 08:58:24 +02:00
..
app fix(planner): raise WS frame cap above doc cap (fixes sync reconnect loop) 2026-07-14 08:58:24 +02:00
public Add favicons, apple-touch-icons, and Chrome DevTools JSON 2026-03-29 10:35:03 +02:00
.gitignore Ignore .vitest-attachments in planner 2026-05-10 19:53:42 +02:00
Dockerfile remove the map and ui shim packages 2026-06-10 07:47:59 +02:00
package.json build(deps): bump the production group across 1 directory with 35 updates 2026-07-13 09:29:56 +02:00
react-router.config.ts Complete monorepo toolchain setup (tasks 1.1-1.7) 2026-03-22 12:12:57 +01:00
server.ts fix(sentry): remove hardcoded DSN fallbacks; supply via env in CI 2026-05-25 23:07:07 +02:00
tsconfig.json Fix planner production server + use .ts extensions everywhere 2026-03-25 01:41:33 +01:00
vite.config.ts Fix Sentry build: disable telemetry, fix release version passing 2026-03-27 18:18:00 +01:00
vitest.browser.config.ts Remove invalid oxc.transform config from browser vitest config 2026-05-10 19:05:15 +02:00
vitest.config.ts Split ElevationChart + PlannerMap into deep modules; add visual regression testing 2026-05-10 16:41:23 +02:00