fix: Android Auto browse/search could hang forever on error responses#867
Open
sinful1992 wants to merge 2 commits into
Open
fix: Android Auto browse/search could hang forever on error responses#867sinful1992 wants to merge 2 commits into
sinful1992 wants to merge 2 commits into
Conversation
getIndexes, getDirectories, getArtistAlbum, getPlaylistSongs and search only resolved their futures on a fully successful response. Any HTTP error or unexpected body left the future unresolved forever, so the Android Auto browse or search screen showed an infinite loading spinner until the app was killed. Resolve with an error result in those cases, matching the pattern the other repository methods already use.
Contributor
📝 WalkthroughWalkthrough
ChangesAutomotive response handling
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Contributor
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@app/src/tempus/java/com/cappielloantonio/tempo/repository/AutomotiveRepository.java`:
- Around line 600-601: Guard getSubsonicResponse() before any dereference in all
five changed branches, including the branch containing the
LibraryResult.ofError(SessionError.ERROR_BAD_VALUE) fallback. Handle a missing
subsonic-response by completing the corresponding future with the appropriate
error instead of allowing the lateinit access to throw; alternatively, make
ApiResponse.subsonicResponse nullable and update these checks accordingly.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro Plus
Run ID: 452c2d8f-0cee-4536-9413-343b1dae9451
📒 Files selected for processing (1)
app/src/tempus/java/com/cappielloantonio/tempo/repository/AutomotiveRepository.java
… a successful reply
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.
What
getIndexes,getDirectories,getArtistAlbum,getPlaylistSongsandsearchinAutomotiveRepositoryonly resolved their futures on a fully successful response. Any HTTP error or unexpected body left the future unresolved forever, so opening an artist, a playlist, a music folder, or searching in Android Auto during a flaky server moment showed an infinite loading spinner until the app was killed.This resolves those futures with an error result in the failure cases, matching the pattern the other 16 repository methods already use (
LibraryResult.ofError), so the car UI shows its error state and stays usable.10 lines, no behaviour change on the happy path.
Testing
assembleDebugbuilds clean.Summary by CodeRabbit