mirror of
https://github.com/1Remote/1Remote.git
synced 2026-04-25 13:36:03 +03:00
[PR #1018] [MERGED] Fix race condition in ObservableCollection replacement causing VirtualizingWrapPanel crash #941
Labels
No labels
area-configuration
area-ct-app
area-ct-rdp
area-ct-remoteapp
area-ct-ssh
area-ct-vnc
area-launcher
area-list
area-tags
area-teamwork
bug
chore
dependencies
general-build/ci
general-performance
general-refactor
general-security
general-supportive
general-ux
meta-documentation
meta-enhancement
meta-enhancement
meta-feature
meta-help-wanted
meta-unknown-error
priority-hi
priority-low
pull-request
question
resolution-duplicate
resolution-invalid
resolution-wontfix
stale
task-put-off
task-still-considering
task-working-in-progress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/1Remote#941
Loading…
Add table
Add a link
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?
📋 Pull Request Information
Original PR: https://github.com/1Remote/1Remote/pull/1018
Author: @Copilot
Created: 11/6/2025
Status: ✅ Merged
Merged: 11/21/2025
Merged by: @VShawn
Base:
main← Head:copilot/fix-crash-issue-1014📝 Commits (4)
a93a93fInitial plan2a05d3fFix race condition crash in VirtualizingWrapPanel during ListView rebuilddaf62cdApply same fix to ServerTreeViewModel for consistency1f45c00Remove redundant PropertyChanged unsubscribe operations📊 Changes
2 files changed (+46 additions, -21 deletions)
View changed files
📝
Ui/View/ServerView/List/ServerListPageViewModel.cs(+25 -13)📝
Ui/View/ServerView/Tree/ServerTreeViewModel.cs(+21 -8)📄 Description
Closes #1014
Description
The application crashes with
ArgumentOutOfRangeExceptionduring window resize when ListView is rebuilt. The crash occurs inVirtualizingWrapPanel.Virtualize()when accessing collection indices.Root cause:
BuildView()creates a newObservableCollectionand assigns it toVmServerList, breaking WPF binding references. When window resize triggers layout measurement immediately after, the virtualization panel accesses stale indices from the replaced collection.Changes
new ObservableCollection<T>()assignment withClear()+Add()pattern in bothServerListPageViewModelandServerTreeViewModelCollectionChangedhandler registration fromBuildView()to constructor (was re-registering on every rebuild)PropertyChangedunsubscribes already performed earlierTradeoffs
Slightly more verbose code (explicit loop vs constructor) in exchange for collection reference stability and WPF binding safety.
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.