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

Fix for uncaught attemptChangeSize Error #4258

Merged
merged 3 commits into from Jul 28, 2016
Merged

Conversation

zhouyx
Copy link
Contributor

@zhouyx zhouyx commented Jul 28, 2016

No description provided.

@zhouyx
Copy link
Contributor Author

zhouyx commented Jul 28, 2016

I test ads example locally, don't see uncaught errors now
PTAL

@@ -86,7 +86,7 @@ export class AmpList extends AMP.BaseElement {
const scrollHeight = this.container_./*OK*/scrollHeight;
const height = this.element./*OK*/offsetHeight;
if (scrollHeight > height) {
this.attemptChangeHeight(scrollHeight);
this.attemptChangeHeight(scrollHeight).then(() => {}, () => {});
Copy link
Contributor

Choose a reason for hiding this comment

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

This just needs a #catch.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@jridgewell
Copy link
Contributor

LGTM.

@zhouyx zhouyx merged commit dce7651 into ampproject:master Jul 28, 2016
@@ -156,7 +156,7 @@ export class AmpAdApiHandler {
updateSize_(height, width) {
const targetOrigin =
this.iframe_.src ? parseUrl(this.iframe_.src).origin : '*';
this.baseInstance_.attemptChangeSize(height, width, () => {
this.baseInstance_.attemptChangeSize(height, width).then(() => {
Copy link
Contributor

Choose a reason for hiding this comment

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

sorry to ask: didn't we have a test to cover this ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

We have tests for updateSize_ but we only test that attemptChangeSize(height, width) are been called.
You are right we need to test #postMessage is called.
#4256

ariangibson pushed a commit to Mixpo/amphtml that referenced this pull request Sep 7, 2016
@zhouyx zhouyx deleted the promise-fix branch September 12, 2016 23:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants