conveyal / r5

Developed to power Conveyal's web-based interface for scenario planning and land-use/transport accessibility analysis, R5 is our routing engine for multimodal (transit/bike/walk/car) networks with a particular focus on public transit
https://conveyal.com/learn
MIT License
272 stars 71 forks source link

Incorrect display of regional results referencing deleted destination grids #914

Open abyrd opened 7 months ago

abyrd commented 7 months ago

This does not seem to be a regression, just noting some things that were observed during recent testing.

Some regional results are not displaying properly. These regional result sets show no names in the dropdown box where destinations are selected, and the legend shows a UUID instead of the name of the destinations. If the data set includes results for multiple different destinations, it's not possible to switch between them. That is, the dropdown to select destinations does not contain multiple entries that can be chosen and happen to have no text labels, it just seems to contain nothing. Some set of results is displayed, but it's not revealed which one.

I believe what's going on here is that the destinations used for the regional analysis have been deleted, so the data describing them cannot be fetched from the database. When a destination grid is deleted, we delete both the file and the database entry with its metadata.

The problem can be observed here: https://conveyal.dev/regions/65565506f19205120370ce65/regional/65570a3afe0a400db256cc86?projectId=65565628f19205120370ce67&scenarioId=baseline&scenarioId=baseline&cutoff=45&pointSetId=65565664fe0a400db256cc08&percentile=50

Proposed Solution

In the present system where datasets with active references can be deleted, we would need a UI update to handle the case where the referenced datasets are missing.

We could also conceivably add checks at the UI level to block or confirm the deletion. However, we might get better results by modifying behavior or inserting checks in the deletion API methods:

Some options:

Reproducing the Problem

This problem can be created by just deleting a layer when you don't expect to use it again, after it's been used in a regional analysis. It's not obvious to the user that this will make it impossible to display the results of already-run analyses. An example of how this can happen more indirectly: