-
Notifications
You must be signed in to change notification settings - Fork 178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Block: Fix issues with stories not appearing in lightbox #13493
Merged
swissspidy
merged 2 commits into
main
from
fix/13241-story-not-loading-in-player-after-exiting-the-lightbox
Nov 2, 2023
Merged
Block: Fix issues with stories not appearing in lightbox #13493
swissspidy
merged 2 commits into
main
from
fix/13241-story-not-loading-in-player-after-exiting-the-lightbox
Nov 2, 2023
Conversation
This file contains 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
This fix is required because story was not fully loaded when history state is pushed. If history state is pushed before story is loaded, it will fail (`sanitizedUrlsAreEquals_` conditional check return into `false` which will result into not updating to the story src in player. Reference: https://github.com/ampproject/amphtml/blob/4ce3cd79520dbeaf5ed5364cbff58d3d71dee40e/src/amp-story-player/amp-story-player-impl.js#L1268-L1270
AnuragVasanwala
added
Type: Bug
Something isn't working
AMP Format
Issues that need to be addressed in the AMP story format
P3
Nice to have
Group: Blocks
Issues related to the provided Gutenberg Blocks
labels
Nov 2, 2023
Size Change: +86 B (0%) Total Size: 2.77 MB ℹ️ View Unchanged
|
Plugin builds for ff95895 are ready 🛎️!
|
swissspidy
approved these changes
Nov 2, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice find! This works very well.
swissspidy
changed the title
Fix: 🐛 History state should be pushed after story is loaded
Block: Fix issues with stories not appearing in lightbox
Nov 2, 2023
swissspidy
deleted the
fix/13241-story-not-loading-in-player-after-exiting-the-lightbox
branch
November 2, 2023 16:03
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
AMP Format
Issues that need to be addressed in the AMP story format
Group: Blocks
Issues related to the provided Gutenberg Blocks
P3
Nice to have
Type: Bug
Something isn't working
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.
The goal of the PR is to fix LightBox issue where story won't load after finishing navigating stories (applies to the number of stories > 2).
If history state is pushed before story is loaded, it will fail (
sanitizedUrlsAreEquals_
conditional check return intofalse
) which will result into not updating to the requested storysrc
in the player.Reference:
https://github.com/ampproject/amphtml/blob/4ce3cd79520dbeaf5ed5364cbff58d3d71dee40e/src/amp-story-player/amp-story-player-impl.js#L1268-L1270
Summary
The PR fixes such issue by checking for story flag
storyContentLoaded
and when it istrue
it will push history state. This will make sure that window href won't get updated until story is already ready.Refer
sanitizedUrlsAreEquals_
function which is comparingstoryUrl
withstory.iframe.src
and if they are equal, it will not update it. In our case, our story is not already loaded so we won't update history till the story is ready.User-facing changes
Not applicable.
Testing Instructions
Refer issue #13241 for testing instruction.
Reviews
Does this PR have a security-related impact?
No.
Does this PR change what data or activity we track or use?
No.
Does this PR have a legal-related impact?
No.
Checklist
Type: XYZ
label to the PRFixes #13241