Skip to content

fix(media): align Now Playing query timeout - #847

Merged
altic-dev merged 1 commit into
altic-dev:mainfrom
postoso:fix/media-pause-query-timeout
Aug 13, 2026
Merged

altic-dev merged 1 commit into
altic-dev:mainfrom
postoso:fix/media-pause-query-timeout

Conversation

@postoso

@postoso postoso commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

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

  • 🐞 Bug fix
  • ✨ New feature
  • 💥 Breaking change
  • 🧹 Chore
  • 📝 Documentation update

Related Issue or Discussion

Related to #803.

Testing

  • Tested on Intel Mac
  • Tested on Apple Silicon Mac
  • Tested on macOS version: 15.7.7
  • Ran linter locally: swiftlint --strict --config .swiftlint.yml Sources
  • Ran formatter locally: swiftformat --config .swiftformat Sources (SwiftFormat is not installed locally)
  • Ran tests 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-testing successfully.

Screenshots / Video

  • No UI/visual changes; screenshots/video are not applicable.

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.

@greptile-apps

greptile-apps Bot commented Aug 12, 2026

Copy link
Copy Markdown

Greptile Summary

This PR aligns the Now Playing query timeout with the pinned media adapter while preserving one-shot pause ownership.

  • Raises the production timeout from one second to 2.5 seconds and adds elapsed-time diagnostics.
  • Introduces injectable media-control and timeout dependencies for deterministic testing.
  • Adds Apple Silicon integration coverage for timeout boundaries, duplicate callbacks, playback-state resolution, and resume ownership.
  • Links MediaRemoteAdapter to the integration-test target.

Confidence Score: 5/5

The PR appears safe to merge, with the extended timeout remaining bounded by the existing one-shot pause-ownership gate.

The changed callback and timeout paths retain mutually exclusive completion semantics, late callbacks cannot issue a pause after timeout, and the new deterministic tests exercise the relevant ownership boundaries.

Reviews (1): Last reviewed commit: "fix(media): align Now Playing query time..." | Re-trigger Greptile

@altic-dev
altic-dev merged commit b5d707d into altic-dev:main Aug 13, 2026
6 checks passed
@postoso
postoso deleted the fix/media-pause-query-timeout branch October 5, 2026 01:35
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.

2 participants