Skip to content

fix: track list multi-selection by info-hash instead of Torrent objects#108

Merged
Michael-128 merged 2 commits into
mainfrom
fix/multi-selection
Jul 6, 2026
Merged

fix: track list multi-selection by info-hash instead of Torrent objects#108
Michael-128 merged 2 commits into
mainfrom
fix/multi-selection

Conversation

@Michael-128

Copy link
Copy Markdown
Owner

Description

Resolves an issue where active multiple-selection checkmarks would disappear from the list view on the next 2-second background telemetry sync poll.

Key Changes

  • Identifier-Based Selection: Changes the selectedTorrents state inside TorrentListHelperViewModel from Set<Torrent> to Set<String> (tracking unique info-hashes).
  • Eliminate Value-Type Mismatches: Because Torrent properties (speeds, progress, ETA) change on every sync poll, the struct's default synthesized hash value changes. Tracking
    selections by immutable String hashes ensures selection states persist during telemetry updates.
  • Unit Tests: Adds testSelection_PersistsAcrossTelemetryRefresh using a reactive XCTestExpectation model update to verify that selection states remain intact when a mock
    torrent's speeds and progress are updated.

@Michael-128 Michael-128 merged commit 0b77612 into main Jul 6, 2026
1 check failed
@Michael-128 Michael-128 deleted the fix/multi-selection branch July 6, 2026 16:59
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