Skip to content

fix(sync): bound playlist deletion memory and shared EPG orphan lookup - #384

Open
Kimlimp wants to merge 1 commit into
bilipp:mainfrom
Kimlimp:perf/playlist-cleanup-memory
Open

Kimlimp wants to merge 1 commit into
bilipp:mainfrom
Kimlimp:perf/playlist-cleanup-memory

Conversation

@Kimlimp

@Kimlimp Kimlimp commented Nov 6, 2026 •

Copy link
Copy Markdown

Summary

  • Bounded EPG orphan lookup: Eliminates unbounded fetch of all surviving channels across all other playlists.
  • Fast-path for no-EPG playlists: Immediately skips guide orphan lookup when the removed playlist has no EPG channels.
  • Keyset-paged candidate batches: Evaluates removed channels and surviving references in bounded batches (500 per page) inside an autoreleasepool, keeping resident memory strictly O(batchSize).
  • Preserved shared guide listings: Only guide listings with zero surviving channel references are pruned.
  • Bounded series cascade: Reduces Series deletion page size from 2,000 to 200, avoiding memory spikes when cascading to episodes.

Testing

  • Added tests in PlaylistDeletionTests covering no-EPG playlists, multi-playlist shared guides, cloud reconcile entry point, single huge series (1,500 episodes), and multi-page channel batches.
  • Verified all tests in PlaylistDeletionTests and CloudSyncDeletionTests pass on iOS 27.2 Simulator (iPhone 18 Pro).
  • Passed swiftformat and swiftlint pre-commit checks.

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