Skip to content
This repository was archived by the owner on Jan 15, 2024. It is now read-only.
This repository was archived by the owner on Jan 15, 2024. It is now read-only.

do app updates properly #7

@doggu

Description

@doggu

the plotter portion of the extension currently makes quite a few unnecessary additional calls to Schedule Builder's API as well as rendering/adding the map/other UI elements as many times.

there are three main reasons for this issue:

  • the extension runs updates asynchronously, so when Schedule Builder's JS updates the page in 3 passes (or any number) it sends 3 updates to the plotter virtually simultaneously, which results in the cache being missed twice despite the "first" call populating it
  • mutations to the DOM are not actually looked at, the event is just taken to be any change to the node hierarchy or an attribute change and the appropriate functions are called
  • the extension has no knowledge of the state of the map as it appears to users, so it just redraws the entire thing constantly to keep it up-to-date

while it is not a significant issue to make these extra calls to the API nor does it impact the functionality of the map, narrowing down when exactly to send updates to more predictable/reliable criteria (e.g. only loading the map/button when the page has finished adding its own UI) instead of firing updates as often as possible could make debugging significantly easier in the future as the complexity of the elements being added to the page grows (e.g. a proper mapping/routing service).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions