Repository navigation
fix(post): single-flight open guard, focus-gated autoplay, autoplay race - #16
Merged
Merged
Conversation
- single-flight guard for opening the post screen: rapid repeat taps on a card no longer stack multiple post screens (each with its own native player layering audio). The guard covers exactly the in-flight window — push until the pushed screen's transition ends (blur cleanup is the fallback unlock) — with no timer; once focused, the same video opens again immediately. - autoplay is gated on screen focus: a screen stacked under another — or whose detail query resolves long after the user backed out — never starts playing when its source lands late. The resume-on-refocus behavior is kept. - the play intent rides player construction + a readyToPlay re-assert: useVideoPlayer recreates the whole native player when the source lands, and a play() fired right after that recreation can race the native prepare and be silently dropped — the video then sat paused forever. Manual pause still wins over the retry. - retry: 0 on the video detail query: one 12s timeout then the error state with a retry button, instead of ~48s of spinner on a dead network that reads as a freeze.
💯 Test Coverage
😎 Tests Results
👀 Tests Details • (56%)
|
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.
single-flight guard for opening the post screen: rapid repeat taps on a card no longer stack multiple post screens (each with its own native player layering audio). The guard covers exactly the in-flight window — push until the pushed screen's transition ends (blur cleanup is the fallback unlock) — with no timer; once focused, the same video opens again immediately.
autoplay is gated on screen focus: a screen stacked under another — or whose detail query resolves long after the user backed out — never starts playing when its source lands late. The resume-on-refocus behavior is kept.
the play intent rides player construction + a readyToPlay re-assert: useVideoPlayer recreates the whole native player when the source lands, and a play() fired right after that recreation can race the native prepare and be silently dropped — the video then sat paused forever. Manual pause still wins over the retry.
retry: 0 on the video detail query: one 12s timeout then the error state with a retry button, instead of ~48s of spinner on a dead network that reads as a freeze.