Skip to content

fix(live): suppress only confirmed exact source replay - #715

Merged
superuser404notfound merged 1 commit into
superuser404notfound:mainfrom
yucelokan:codex/exact-live-replay-guard
Oct 7, 2026
Merged

superuser404notfound merged 1 commit into
superuser404notfound:mainfrom
yucelokan:codex/exact-live-replay-guard

Conversation

@yucelokan

Copy link
Copy Markdown
Contributor

Summary

Distinguish exact packet overlap after reconnect from a legitimate timestamp discontinuity. Suppress replay only after both audio and video confirm matching timestamp and payload history.

What changed

  • Buffer candidate overlap with bounded packet/signature history and SHA-256 payload identity.
  • Return uncertain, mismatched, exhausted or interrupted candidates to the ordinary producer path.
  • Keep bridged/side-audio routes excluded and preserve source-starvation watchdog detection.

Test plan

  • Device / OS: Apple M1 Pro Mac, macOS 27.0.1; Xcode 27.0 (27A266a), Swift 6.4.
  • Source media: synthetic audio/video packet timestamps and compressed payload signatures plus controlled no-cut watchdog clocks; no encoded media fixture or HDR/DV path in these regressions.
  • Result: 24 XCTest and 15 Swift Testing cases passed with swift test --jobs 4 --filter 'LivePacketReplayGuardTests|Issue406NoCutWatchdogTests|LiveSegmentCutterTests|SourceStarvation|PublicAPIDocumentationTests|DocumentedConstantsTests'. Exact overlap, audio-first overlap, differing content, expired history and source starvation during replay are covered. swift build --jobs 4, documentation links and git diff --check pass.
  • Production use: this behavior already ships in WUW's App Store release, with physical iPhone and Apple TV use. The isolated PR revision is based on upstream 7.28.3; the reproducible checks above describe this revision rather than claiming a new device run.

Checklist

  • CHANGELOG.md updated
  • Commit messages follow Conventional Commits (feat(...), fix(...), chore(...))
  • The fix lives in the engine, not in a host-side workaround
  • Public API changes are intentional and documented

@superuser404notfound
superuser404notfound merged commit 225f56e into superuser404notfound:main Oct 7, 2026
@superuser404notfound

Copy link
Copy Markdown
Owner

Thank you. Released in 7.30.0 (beed2cc5).

One follow-up on top (7e701a7d): Signature hashes the packet's own buffer through an UnsafeRawBufferPointer and stores SHA256.Digest directly, so a live packet no longer costs a Data copy plus a [UInt8] allocation. The origin == .side arm in liveReplaySample was unreachable behind its own sideAudioDemuxer == nil guard and is gone. The Data initializer stays for the tests.

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