Page MenuHomePhabricator

[Segmentation] Deleting an empty group causes Workbench crash
Closed, ResolvedPublic

Description

When you have already (accidently) deleted all labels in a group making it empty, removing that empty group causes workbench to crash.

Steps:

  1. Create 3 groups for labeling
  2. Remove all labels from group 1
  3. Click on group 1 and press remove group button (because you can't add new label to it anyway. Bug?) -> Group 2 with labels are removed (another bug?)
  4. Again, Click on the empty group 1 and press remove group button

Workbench crashed.

Conceptually, I think it happens "Remove current group" removes group in focus. Since group 2 was removed and, group 1 don't have any labels, there's no more any "current" group to remove. This could be causing an NPE, while removing internally.

Revisions and Commits

rMITK MITK
Restricted Differential Revision
Restricted Differential Revision
Restricted Differential Revision
Restricted Differential Revision
Restricted Differential Revision

Event Timeline

This comment was removed by a178n.

Can reproduce. I agree with your explanation. When group 1 is empty, it can't actually be selected. There's the dotted line, but group 2 is still in focus (which is stated in the popup dialog). I guess after group 2 is deleted the "focus" is not set correctly.
I guess we could either ensure that the next available label is automatically selected, since usually there is always a label selected, or the "Delete group" should be respective to the dotted-line selection of a group.
I'm not sure if this contradicts previous discussions we had about the topic, but I would actually prefer the second option. Generally, it feels weird that one is able to kind of select a group and interact with its context menu, but the buttons above still refer to the group of the focused label. For example, it is impossible to add a label to an empty group with the buttons (except for the first one).

a178n triaged this task as Unbreak Now! priority.Nov 15 2023, 5:12 PM
a178n updated the task description. (Show Details)
kislinsk added a revision: Restricted Differential Revision.Nov 16 2023, 10:53 AM