Repository navigation
Fix popup losing track of current video after background port reconnects - #2571
Open
dieroboter wants to merge 2 commits into
Open
dieroboter wants to merge 2 commits into
dieroboter wants to merge 2 commits into
Conversation
… reconnects Key popupPort by port.sender.tab (with cleanup on disconnect) instead of an active-tab query at connect time, prefer sender.tab in the background tabs relay, resync popup state after a port reconnect, and trust the sponsorStart response's creatingSegment flag when nothing is stored under the popup's videoID.
Fix popup losing track of the current video after its background port reconnects
This branch has not been deployed
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.
To test this pull request, follow the instructions in the wiki.
On Firefox, the segment submission popup can get stuck on the previous video after its connection to the background script drops and reconnects. Clicking "Start Segment Now" flips the button, then reverts it about 200ms later, and the segment looks unsaved until the page is reloaded.
Cause: the background keyed the popup's port by an active-tab query at connect time. If the port reconnected while a different tab was active, the port was filed under the wrong tab, later video-change updates for the real tab were posted to the dead port and swallowed, and the popup's video ID stayed frozen on the previous video.
sponsorStartcarries no video ID, so the segment was saved under the video actually playing while the popup checked the frozen one and found nothing.Changes:
popupPortbyport.sender.tab(cleaned up on disconnect), with the active-tab query only as a fallback; the tabs message relay also preferssender.tabsponsorStartresponse'screatingSegmentflag instead of reverting