Skip to content

Fix crash: collection modified during enumeration in PackageRepository - #19

Merged
emosaru merged 1 commit into
avaloniafrom
fix/issue-14-packagemanager-collection-crash
Apr 12, 2026
Merged

Fix crash: collection modified during enumeration in PackageRepository#19
emosaru merged 1 commit into
avaloniafrom
fix/issue-14-packagemanager-collection-crash

Conversation

@emosaru

@emosaru emosaru commented Apr 11, 2026

Copy link
Copy Markdown
Contributor

Summary

  • ForceRefreshProperty was called inside the mPackages.Add loop in MWebClient_DownloadDataCompleted, triggering CurrentPackageHasUpdateAvailable to enumerate repository.Packages while new entries were still being added to it
  • Moved both ForceRefreshProperty calls to after the loop completes (once all packages are populated), just before DownloadStatus = Complete

Test plan

  • Launch EmoTracker and leave running for 30+ minutes with a package loaded
  • Verify no InvalidOperationException: Collection was modified crash occurs
  • Verify update-available indicators still appear correctly after repository refresh

Closes #14

🤖 Generated with Claude Code

@emosaru
emosaru requested a review from a team April 11, 2026 19:03
ForceRefreshProperty was called inside the mPackages.Add loop, triggering
CurrentPackageHasUpdateAvailable to enumerate repository.Packages while
new entries were still being added. Moved both ForceRefreshProperty calls
to after the loop completes (just before DownloadStatus = Complete).

Fixes #14

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@emosaru
emosaru force-pushed the fix/issue-14-packagemanager-collection-crash branch from 49e96d6 to da91db0 Compare April 11, 2026 23:33
@emosaru
emosaru merged commit 86581a0 into avalonia Apr 12, 2026
3 checks passed
@emosaru
emosaru deleted the fix/issue-14-packagemanager-collection-crash branch April 12, 2026 00:21
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.

1 participant