Repository navigation
fix(media): align Now Playing query timeout - #847
Merged
Merged
Conversation
Greptile SummaryThis PR aligns the Now Playing query timeout with the pinned media adapter while preserving one-shot pause ownership.
|
4 of 12 tasks
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.
Description
FluidVoice gave the Now Playing query one second to finish, while the pinned media adapter can legitimately wait about two seconds before returning. A valid playing result arriving after the outer timeout was discarded, so no pause request was sent.
This aligns the outer timeout to 2.5 seconds, records elapsed query time in terminal diagnostics, and adds deterministic coverage around timeout and pause ownership behavior. It keeps pause requests inside the existing one-shot gate so a late callback cannot leave media paused after the session has moved on.
Type of Change
Related Issue or Discussion
Related to #803.
Testing
swiftlint --strict --config .swiftlint.yml Sourcesswiftformat --config .swiftformat Sources(SwiftFormat is not installed locally)xcodebuild test -project Fluid.xcodeproj -scheme Fluid -destination 'platform=macOS,arch=arm64' -only-testing:FluidDictationIntegrationTests/MediaPlaybackServiceTests CODE_SIGN_IDENTITY='' CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO(6 tests passed)Also ran an unsigned Apple Silicon
build-for-testingsuccessfully.Screenshots / Video
Notes
This fixes the premature timeout contract. It does not assume that timeout is the only cause of #803; the elapsed-time diagnostics will help distinguish future failures.