"Delete Selected" button is incorrectly active after uploading designs immediately after a deletion
Summary
After a certain series of events, the "Delete Selected" button is active when it shouldn't be. See steps below.
Steps to reproduce
- Upload a design
- Delete the design
- Upload another design
- Observe the "Delete Selected" button. It will be active when there are no designs selected
What is the current bug behavior?
"Delete Selected" is active when it shouldn't be (no designs are selected)
What is the expected correct behavior?
"Delete Selected" should be inactive
Output of checks
This bug happens on GitLab.com
Possible fixes
The @done
event isn't getting emitted from the apollo-mutation
component within the design-destroyer
component. The selected designs are cleared when this @done
event is being emitted, but because it's not being emitted, the index
-level Vue component still thinks designs are selected, hence why it is in it's active state.
The reason @done
isn't emitted can be traced to ee/app/assets/javascripts/design_management/utils/cache_update.js
Line 16:
data.project.issue.designCollection.designs.edges = [...changedDesigns];
Commenting this out (while breaking the functionality), results in @done
being emitted. So, I assume it's something to due with the particular way in which we're mutating the cache here doesn't play well with Apollo.