fix(connect): fall back to index when context unavailable resolving track - #1747
Open
zeemawn wants to merge 1 commit into
Open
fix(connect): fall back to index when context unavailable resolving track#1747zeemawn wants to merge 1 commit into
zeemawn wants to merge 1 commit into
Conversation
…rack get_context() returning Err propagated out of the track-resolution path, aborting the request. Fall back to the provided index (or 0) and warn instead, so playback continues when the Default context is unavailable.
Contributor
There was a problem hiding this comment.
Pull request overview
Updates Connect track resolution to fall back when the Default context is unavailable.
Changes:
- Handles missing context during URI and UID resolution.
- Logs warnings and uses the fallback index or zero.
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+1399
to
+1400
| warn!("context unavailable when resolving track by UID, using fallback index {fallback_index:?}: {why}"); | ||
| Ok(fallback_index.unwrap_or_default()) |
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 resolving the current track by URI or UID,
SpircTaskcallsget_context(ContextType::Default)?. If the Default context is notavailable, the
?propagates the error out of the whole track-resolutionpath and the request is abandoned.
On a long-running Connect device this happens regularly, and shows up as:
Since a
fallback_indexis already available at that point, this handlesthe error instead of propagating it: fall back to that index (or 0) and
log a warning, so playback continues rather than the request failing.
Observed on a Raspberry Pi 3B+ running as a persistent Connect endpoint,
where the Default context is frequently unavailable after idle periods.
🤖 Generated with Claude Code