Skip to content

core/model: make diffUpdate handle reordering without duplicating rows#767

Merged
outfoxxed merged 1 commit into
quickshell-mirror:masterfrom
Mic92:qs-upstream/objectmodel-diffupdate-reorder
Apr 27, 2026
Merged

core/model: make diffUpdate handle reordering without duplicating rows#767
outfoxxed merged 1 commit into
quickshell-mirror:masterfrom
Mic92:qs-upstream/objectmodel-diffupdate-reorder

Conversation

@Mic92

@Mic92 Mic92 commented Apr 26, 2026

Copy link
Copy Markdown
Contributor

diffUpdate inserted an element at its target index without removing it from its previous index, so a pure permutation like [d,a,b,c] -> [a,b,c,d] left every misplaced element in the model twice and the removal pass never reclaimed them because their pointer is still in newValues. Any caller that re-sorts an existing list (dbusmenu re-layout, desktopentry re-scan) can hit this.
I found this via a downstream niri workspace backend where a monitor hot-plug re-sorts the model: https://github.com/noctalia-dev/noctalia-qs/pull/35

diffUpdate inserted an element at its target index without removing it
from its previous index, so a pure permutation like [d,a,b,c] ->
[a,b,c,d] left every misplaced element in the model twice and the
removal pass never reclaimed them because their pointer is still in
newValues. Any caller that re-sorts an existing list (dbusmenu
re-layout, desktopentry re-scan) can hit this. Found via a downstream
niri workspace backend where a monitor hot-plug re-sorts the model.
@outfoxxed
outfoxxed merged commit 055e384 into quickshell-mirror:master Apr 27, 2026
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants