Skip to content

fix(driver): show invalid route upload errors on upload page#212

Open
hir-al-14 wants to merge 1 commit into
benevolentbandwidth:mainfrom
hir-al-14:fix-upload-route-error
Open

fix(driver): show invalid route upload errors on upload page#212
hir-al-14 wants to merge 1 commit into
benevolentbandwidth:mainfrom
hir-al-14:fix-upload-route-error

Conversation

@hir-al-14

Copy link
Copy Markdown
Contributor

Summary

  • Invalid route uploads now show a clear error on /upload-route instead of sending drivers to the deprecated driver_assist tester upload screen.
  • The old in-page Driver Assist JSON upload fallback has been removed.

Motivation

  • Drivers should see upload failures on the page where they selected the route file so they can retry immediately.
  • Before this change, invalid JSON or invalid route-shaped JSON was only detected after navigating to /driver_assist, which exposed an old unstyled fallback upload UI.

Changes

  • Frontend:

    • Added shared /upload-route validation that parses and transforms route uploads before navigating.
    • Stores invalid upload errors in session storage and renders them in the existing /upload-route error block.
    • Redirects Driver Assist import failures back to /upload-route instead of rendering the deprecated fallback screen.
    • Removed the deprecated Driver Assist direct-upload fallback path, unused file input state, import handler, and related styles.
    • Added regression coverage for rejecting invalid upload-route files before handing them to Driver Assist.
  • Backend: No backend changes.

Validation

Frontend

  • npm.cmd --prefix app/ui run lint
  • npm.cmd --prefix app/ui run format:check
  • npm.cmd --prefix app/ui run typecheck
  • npm.cmd --prefix app/ui run test
  • npm.cmd --prefix app/ui run build
  • npm.cmd --prefix app/mobile run lint
  • npm.cmd --prefix app/mobile run typecheck

Backend

  • cmake --preset dev
  • .github/scripts/check-backend-static.sh build/dev
  • cmake --build --preset dev --parallel
  • ctest --preset dev --output-on-failure --no-tests=error -LE 'e2e|docker'

Risk

  • Main behavior change is limited to the Driver Assist route upload/import flow.
  • Valid route files still import and navigate to /driver_assist.
  • Invalid files now stop on /upload-route with the existing styled error UI.

Rollout and Recovery

  • Roll out normally with the frontend deploy.
  • If anything looks wrong, revert this PR to restore the previous Driver Assist import behavior.

High-Signal PR Checklist

  • The summary states the user-visible or operational outcome, not just file names.
  • The motivation explains why this change is needed now.
  • The change list separates frontend, backend, infrastructure, and documentation work where applicable.
  • Validation includes exact commands run, relevant output, and any checks intentionally skipped.
  • Risks, migrations, feature flags, and rollback steps are called out when relevant.
  • Screenshots or request/response examples are included for UI and API behavior changes.

Related Issues

#198

  • The deprecated in-page tester upload screen in Driver Assist is removed.
  • Uploading an invalid route file via /upload-route shows an error on /upload-route.
  • Valid route files still import and navigate to /driver_assist.
  • Dead code from the removed fallback path is removed.
  • Regression test added for the invalid upload-route error path.

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