CityofToronto / bdit_flashcrow

Working repository for MOVE, a project to modernize transportation data systems at the City of Toronto.
MIT License
9 stars 2 forks source link

The "undo" button doesn't cancel bulk export #927

Closed mkewins closed 3 years ago

mkewins commented 3 years ago

What Happened The "undo" button on the export reports notification pop-up doesn't do anything.

What Should Happen I expected it would cancel the export from processing.

To Reproduce Steps to reproduce the bug:

  1. Select 2+ locations
  2. Click through to view data for the multi-location selection
  3. Click on export reports (login if prompted)
  4. Select file format and start export
  5. Click "Undo" from the notification that pops up with status of the export
  6. See that clicking on that button does nothing
  7. Go to Manage Downloads
  8. See that the export is still in progress

Screenshots n/a

Additional Notes I'm unsure what the intended functionality of the "undo" button is, both in the pop-up notification, and on the Manage Downloads page.

candu commented 3 years ago

Hmm. It's calling PG_BOSS.cancel(), which is supposed to mark the job as cancelled. I'm guessing (without looking deeper at this point) that the loop in JobRunnerGenerateReports just keeps going anyways, since it's not checking anywhere if the job has been cancelled. If that's true, it will continue to update progress, and will eventually mark the job as completed, which is exactly what would happen if the user didn't click "Undo".

I'm wondering if we should just...hide the button for now until we have time to debug further?