Skip to content

Race Condition in Stop Fetching Due to Rapid Map Zooming/Panning #232

@Sundaresan-Karunakaran

Description

@Sundaresan-Karunakaran

When users rapidly zoom in and out or pan the map quickly, multiple requests to fetch stops are triggered in quick succession. This can lead to a race condition where older requests complete after newer ones, resulting in outdated or inconsistent stop data being displayed on the map. More importantly, it also causes inefficiencies, as unnecessary requests are processed for data that is no longer relevant or useful.

Steps to Reproduce

  1. Open the map interface.
  2. Quickly zoom in and out multiple times or pan rapidly.
  3. Observe the network requests in the developer tools (many overlapping requests are sent).
  4. Sometimes, older data appears instead of the latest fetched stops.

Expected Behavior

  • Only the most recent stop data should be displayed after zooming/panning.
  • Older requests should be properly canceled when a new request is initiated.

Additional Info
This issue is similar to the issue #220 .

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