Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect display of regional results referencing deleted destination grids #914

Open
abyrd opened this issue Dec 1, 2023 · 0 comments
Open

Comments

@abyrd
Copy link
Member

abyrd commented Dec 1, 2023

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:

  • com.conveyal.analysis.controllers.OpportunityDatasetController#deleteDataset
  • com.conveyal.analysis.controllers.OpportunityDatasetController#deleteSourceSet

Some options:

  • We could prevent deleting destination grids referenced by any regional results.
  • We could soft-delete the grid (both file and database entry).
  • We could perform the soft-delete only if the data set is referenced by results or other fields, otherwise hard-delete.
  • We could hard-delete only the file and soft-delete the database entry, allowing it to still be used when displaying data. This would require skipping the display of the grid itself on the map, but still show other details.

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:

  • Import LODES data for a region.
  • Run a regional analysis for one layer of the LODES data.
  • Accidentally import LODES data again at the same zoom level (e.g. when intending to import at another zoom level)
  • Go to delete the duplicate batch of imported LODES data, but end up deleting the original batch with the same name, thinking they're both equivalent.
  • Now all existing results cannot be fully displayed because they reference the first LODES import.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant