fix(webapp): remove unused Electric sync trace routes - #4400
Merged
Conversation
`/sync/traces/:traceId` and `/sync/traces/runs/:traceId` were added with the original ElectricSQL run page and were orphaned when the dashboard hooks that consumed them were deleted. Nothing in the repo references either route. Removing them also drops the now-unused `electricShape.server.ts` helpers (`OtelTraceIdSchema`, `RESERVED_ELECTRIC_SHAPE_PARAMS`, `TraceScope`, `buildElectricTraceWhereClause`); the realtime tag sanitisers in that module stay, as does `longPollingFetch`, which `realtimeClient.server.ts` still uses. The run lookup these loaders performed keyed on `TaskRun.traceId` alone, which is not an indexed query shape, and it had no remaining caller. Test coverage for the removed loaders is pruned from `spanTraceRoutes.replicaLag.test.ts` and `runOpsStore.routesSpanTraceReadView.replicaLag.test.ts`; the span-detail and trace route cases in both files are unchanged. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J9DvHZJBMUFGU9Mvtr7zor
|
…test Removing the sync-route helper left the describe block flush against the preceding function. Cosmetic only. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J9DvHZJBMUFGU9Mvtr7zor
ericallam
marked this pull request as ready for review
July 28, 2026 07:30
ericallam
approved these changes
Jul 28, 2026
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.
Requested by Eric Allam · Slack thread
Removes two dead Remix routes and the helpers only they used.
app/routes/sync.traces.runs.$traceId.ts(/sync/traces/runs/:traceId) andapp/routes/sync.traces.$traceId.ts(/sync/traces/:traceId) were added with the original ElectricSQL run page and lost their only consumers when the dashboard hooks that called them were deleted. Nothing in the repo references either route today.Also removed, because the deleted routes were their only callers:
OtelTraceIdSchema,RESERVED_ELECTRIC_SHAPE_PARAMS,TraceScope,buildElectricTraceWhereClausefromapp/v3/electricShape.server.ts(the file stays —UNSAFE_REALTIME_TAG_CHARS/sanitizeRealtimeTagForSql/sanitizeRealtimeTagsForSqlare still used byrealtime.v1.runs.tsandrealtimeClient.server.ts)apps/webapp/test/spanTraceRoutes.replicaLag.test.tsandinternal-packages/run-store/src/runOpsStore.routesSpanTraceReadView.replicaLag.test.tsapp/utils/longPollingFetch.tsis untouched —realtimeClient.server.tsstill uses it.runOpsStore.ts/PostgresRunStore.tsare untouched too; the unrouted-lookup mechanism there is generic and stays.As a plain code fact: the run lookup these loaders performed keyed on
TaskRun.traceIdalone, which is not an index-backed query shape. That is noted only as context for why the code is not worth keeping around unused.Judgement call worth a maintainer's opinion
The request was specifically about
/sync/traces/runs/:traceId, the route that looks up a run bytraceId. This PR also deletes its sibling/sync/traces/:traceId. The reasoning:If you would rather keep the sibling, reverting just that one file deletion is easy and does not affect the rest of this PR — say the word and I will restore it along with the helpers it needs.
✅ Checklist
Testing
Verification run locally from the repo root:
pnpm run formatpnpm run lint:fixpnpm run lintpnpm run typecheck --filter webapppnpm run typecheck --filter @internal/run-storeA ripgrep sweep for
sync.traces,sync/traces,syncTraceRunsLoader,buildElectricTraceWhereClause,OtelTraceIdSchemaandRESERVED_ELECTRIC_SHAPE_PARAMS(excludingnode_modules) returns zero hits.Not fully verified: both edited test files are testcontainers suites and need a Docker runtime, which was not available in my environment. I confirmed each file collects correctly with exactly the three intended remaining tests and no import errors — notably, dropping the
session.server/controlPlaneResolver.server/longPollingFetch/env.servermocks does not break module loading for the surviving loaders. The assertions themselves then failed only onCould not find a working container runtime strategy. CI should be the real signal here.Per
apps/webapp/CLAUDE.md,pnpm run build --filter webappwas deliberately not run.Changelog
Removed two unused sync routes left over from the original ElectricSQL run page, along with the helpers and tests that existed only to serve them. No behaviour change — neither route had any caller.
Screenshots
n/a — no user-visible surface changes.
💯