Skip to content

Potential bad state from dragged_label_for_reinsert #9

@miker2

Description

@miker2

There's a potential issue here: if dragged_label_for_reinsert is None (meaning the label widget couldn't be found in self._labels), an error is printed, and the event is ignored. However, self._traces.pop(original_idx) (line 279) has already modified the _traces list.

This could leave the SubPlotWidget in an inconsistent state where _traces and _labels are out of sync.

Could we, for instance, find dragged_label_for_reinsert before modifying self._traces? Or, if an error occurs after _traces.pop(), should there be an attempt to restore _traces to its previous state to maintain consistency?

Originally posted by @gemini-code-assist[bot] in #2 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions