Kolibri: Impossible to cancel a delete task

Created on 9 Dec 2019  路  9Comments  路  Source: learningequality/kolibri

Observed behavior

When a delete task has been initiated, it seems impossible to cancel. On tasks with lower number of resources to delete, it apparently finishes before one even manages to click the Cancel button, and on tasks with more resources selected to delete, the button does not seem active at all, and the task continues without allowing the user to cancel.

2019-12-09_8-00-37

Plus there's still something iffy about the annotation. Above I imported around 500 MB from the KA-BG channel, but after selecting around 400 MB to delete, and without me being able to cancel - it reports 1GB deleted! To top it off Manage channel still reports all resources as present on the device, even though that amount/size of resources is clearly not present on the device HD.

Expected behavior

Ability to cancel a delete task after it's started.
Correctly reported number and size of resources remaining/present on the device.

User-facing consequences

Inability to correct the error, unmet expectations regarding the available space & resources on the device.

Errors and logs

cancel-delete-logs.zip

Steps to reproduce

Start a delete task and try to cancel.

Context

  • Kolibri version: 0.13.0b4
  • Operating system: Windows 7
  • Browser: both Chrome & FF
P0 - critical bug

Most helpful comment

Well conditionalizing it based on the cancellable property of the task is the most efficient way to hide it when it should be hidden!

All 9 comments

Were you doing any other testing of the delete functionality before you noticed this?

About the "1 GB deleted" (instead of 400 MB deleted), i'm noticing that the code will actually to do some garbage collection of files from other channels. It's possible that the extra 600 MB came from other channels that were being garbage collected.

As for the "cancel" button not being active, the code for TaskPanel.vue seems to only disable the button when the task is in a Canceling state (right before it's actually canceled). Otherwise there should always be some kind of button ("Cancel" or "Clear").

@jonboiser Yes, prior to this I tried twice to cancel a delete task with smaller amount of selected resources, but it always seemed to finish deleting before I could even see the Cancel button. Anyways, no way those 600MB came from prior delete tasks, all in all it was 100MB tops (my connection here sux big time, so I'm very conservative when downloading)

Then I selected 400 MB from that KA-BG channel, and I could finally see the Cancel button, but it seemed inactive, grayed out all through the delete task progress.

One fairly important detail is that the background task itself is not able to be cancelled, so no matter what the user does, the background task will not be interrupted.

Well, if there is no way user can cancel the task, then there should be a much more prominent alert (This cannot be cancelled or undone...!, not just _Are you sure...?_), and no Cancel button, since it's going to be useless.

cc @khangmach @jtamiace

Can we remove just the button for now?

agreed that we should hide the 'cancel' button for deletion tasks

Note that this is probably a regression in the transition to the new task manager - there is a cancellable property on the task metadata that indicates whether a task can be cancelled, I have just verified that the deletion task does not have this set to True. The UI just needs to conditionalize the availability of the cancel button based on this property - looking at the code for the UI it does not seem to do this (although the old UI did).

Dealer's choice!
If making the UI _conditionalize its availability_ is not that much more work than just hiding the button, I'd say go for it!

Well conditionalizing it based on the cancellable property of the task is the most efficient way to hide it when it should be hidden!

Was this page helpful?
0 / 5 - 0 ratings