Skip to content

Missing Road ID validation causes duplicate entries #660

Open

Description

@naiduyaswanthreddy

Description

Currently, the dashboard allows users to submit new road entries without validating if the Road ID already exists. This can result in duplicate road IDs, breaking the uniqueness expected in downstream infra tagging.

Steps to Reproduce

  1. Go to the "Add New Road" form
  2. Enter a Road ID that already exists in the registry
  3. Submit the form

Expected Behavior

The form should validate and alert the user if the Road ID already exists in the system before submission.

Actual Behavior

The form allows submission, and the duplicate Road ID is added, potentially causing data conflicts.

Proposed Fix

  • Add backend validation to check for uniqueness of Road ID
  • Add frontend warning or toast alert if duplicate is detected

Tech Stack

  • Frontend: React
  • Backend: Firebase or PostgreSQL

Tags

Bug, Validation, Road Registry, Infra Tracker

Additional Context

This was observed while testing the sample mock setup as per the DMP #493 mid-point milestone.

Activity

  1. SurbhiAgarwal1 commented on Mar 21, 2026

    @SurbhiAgarwal1

    Hi @naiduyaswanthreddy , I’d like to work on this issue.

    From the description, the problem seems to be missing uniqueness validation for the Road ID, which allows duplicate entries and can lead to downstream data inconsistencies.

    My approach:

    • Add backend validation to enforce uniqueness (DB-level + API check)
    • Return a proper error response if a duplicate Road ID is submitted
    • Add frontend handling (toast/alert) to inform the user immediately
    • Ensure edge cases are handled (race conditions / concurrent submissions)

    I’ll also test the flow end-to-end to confirm duplicates are fully prevented.

    Please let me know if there are any existing constraints or preferred validation patterns to follow.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      ⌂ Proxy