Skip to content

Router: validate Deps.Regions when vehicle or weather routes are wired #8

Description

@aaronbrethorst

From CodeRabbit review on PR #1 (#1 (review)) — Stability, Trivial.

Both the vehicles and weather handlers call resolveRegion, which dereferences deps.Regions on every request. The loud-failure startup block in internal/httpapi/router.go (~148-161) only runs when deps.Auth != nil, so a configuration that sets Deps.Vehicles or Deps.Weather with a nil Deps.Regions passes startup and nil-dereferences on the first request.

buildDeps always sets Regions today, so this is a validation gap rather than a live defect. Extend the startup check to panic when Deps.Regions is nil while either service is wired.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions