Skip to content
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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰story-ads: prevent users getting stuck #19335

Merged
merged 1 commit into from Nov 15, 2018
Merged

馃悰story-ads: prevent users getting stuck #19335

merged 1 commit into from Nov 15, 2018

Conversation

calebcordry
Copy link
Member

If a user taps forward enough times that an ad is inserted but not viewed, then taps backwards, at each backwards navigation event amp-story-auto-ads tries to insert another ad.

This is a regression introduced in #18959 which reset the counter when an ad is viewed (previously it was being reset when the ad was inserted).

I still think that this is the right approach, so this fixes the problem by introducing a new flag that signifies that we are in the state where an ad has been inserted but has not yet been seen.

@calebcordry calebcordry merged commit 39c37ab into ampproject:master Nov 15, 2018
@calebcordry calebcordry deleted the story-stuck branch November 15, 2018 16:37
@lannka
Copy link
Contributor

lannka commented Nov 26, 2018

@calebcordry could you further clarify why backwards navigation behaves differently than forward navigation here?

@calebcordry
Copy link
Member Author

The problem is that going forwards shows you the ad so that then the counter was reset correctly. If you go backwards the counter was not reset so that the algorithm kept thinking you had seen enough pages and would try to insert an ad on the following page.

This problem was introduced in #18959 because we changed the count to be reset on view. Before that it would be reset on insert.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants