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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AMP Ad Fast Fetch: FIE do not remove creative in unlayoutCallback #9396

Merged
merged 2 commits into from May 17, 2017
Merged

AMP Ad Fast Fetch: FIE do not remove creative in unlayoutCallback #9396

merged 2 commits into from May 17, 2017

Conversation

keithwrightbos
Copy link
Contributor

AMP creatives rendered via friendly iframe embed are not removed during unlayoutCallback allowing them to be immediately visible when the user swipes back to the publisher page within the viewer. ResumeCallback does not call onLayoutMeasure in this case as its unnecessary. Wrapped in a4a-fie-unlayout-enabled experiment allowing this feature to be disabled (default is enabled).

Closes #9153

@@ -446,6 +446,12 @@ export class AmpA4A extends AMP.BaseElement {

/** @override */
resumeCallback() {
// FIE that was not destroyed on unlayoutCallback does not require a new
// ad request.
if (!isExperimentOn(this.win, 'a4a-fie-unlayout-enabled') &&
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there another PR to add this experiment?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need unless we want/need to disable this new feature. This was added so that we could easily disable if needed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gotcha

@@ -446,6 +446,12 @@ export class AmpA4A extends AMP.BaseElement {

/** @override */
resumeCallback() {
// FIE that was not destroyed on unlayoutCallback does not require a new
// ad request.
if (!isExperimentOn(this.win, 'a4a-fie-unlayout-enabled') &&
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gotcha

@@ -446,6 +446,12 @@ export class AmpA4A extends AMP.BaseElement {

/** @override */
resumeCallback() {
// FIE that was not destroyed on unlayoutCallback does not require a new
// ad request.
if (!isExperimentOn(this.win, 'a4a-fie-unlayout-enabled') &&
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should match #unlayoutCallback's check, which I think is incorrect.

@@ -1000,6 +1006,10 @@ export class AmpA4A extends AMP.BaseElement {

/** @override */
unlayoutCallback() {
if (!isExperimentOn(this.win, 'a4a-fie-unlayout-enabled') &&
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe this is incorrect, the ! should be removed.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct me if I'm wrong, Keith, but based off Keith's reply to my question above, I think the approach here is that this new behavior will run when the experiment flag doesn't exist, and we'll only add the flag if we need to shut it off.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right this experiment exists as an easy means to disable the new behavior as opposed to enable it. If this is a concern, I can invert and set to 100% enabled in prod/canary configs

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be "disabled" then.

@keithwrightbos
Copy link
Contributor Author

keithwrightbos commented May 17, 2017 via email

@keithwrightbos keithwrightbos merged commit da77dec into ampproject:master May 17, 2017
@keithwrightbos keithwrightbos deleted the a4a_fie_no_unlayoutcallback branch May 17, 2017 22:50
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