Fix looping error when movie/series is deleted from another device#604
Draft
Fix looping error when movie/series is deleted from another device#604
Conversation
When a movie/TV show is deleted from another device while its detail view is open, onBecomeActive triggers reload() which calls the API. The API returns a 404 error, showing an error alert. On macOS, dismissing the alert causes the window to become active again (appearsActive changes), triggering onBecomeActive again, creating an infinite loop. Fix: - Add isNotFound property to API.Error to detect 404 status codes - Remove items from local cache when API returns 404 during get operations - Navigate back from detail views when reload detects a 404 error Co-authored-by: tillkruss <665029+tillkruss@users.noreply.github.com>
Co-authored-by: tillkruss <665029+tillkruss@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Investigate potential causes for issue #603
Fix looping error when movie/series is deleted from another device
Mar 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a movie/series detail view is open and the item is deleted from another device,
onBecomeActivetriggersreload()→ API returns 404 → error alert shown. On macOS, dismissing the alert re-activates the window (appearsActivetoggles), firingonBecomeActiveagain — infinite loop.Changes
API.Error.isNotFound— new computed property matchingbadStatusCode(404)anderrorResponse(404, _)Movies/SeriesModel.getoperation — on 404, remove the item from localitemsbefore re-throwing, keeping local cache consistentMovieView/SeriesDetailView/SeasonViewreload()— on 404, clear the error and reset the navigation path to rootNavigation resets to root (not
removeLast()) since the detail view may have child views pushed on the stack, andonBecomeActivefires for all views in the macOS window hierarchy simultaneously.✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.