ElementStore::remove_label retains the wrong entries — label map gets corrupted #669
Labels
No labels
Context: Bug
Context: Enhancements
Platform: Android
Platform: Linux
Platform: Web
Platform: Windows
Platform: iOS
Platform: macOS
Target: CI
Target: CLI
Target: Dependency
Target: Engine
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
SakulFlee/Orbital#669
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Severity: 🔴 High
File:
Crates/orbital_element/src/store.rs:167-171Bug:
The
remove_labelmethod uses.retain()which keeps entries where the closure returnstrue. The current closure keeps labels that are in the removal list — so it removes everything else, including labels from other elements entirely.Impact: Calling
remove_labelcorrupts the label map: labels from other elements get wiped, and only the ones being "removed" survive for the target element.Example: Element "A" has labels
["a", "b", "c"], element "B" has["d"]. Callremove_label("A", ["a"]). Result: label map contains only"a" → A_id— all other labels from A and B are gone.Fix: Negate the condition:
!(element_id.eq(v) && labels_to_be_removed.contains(k))@SakulFlee