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
Conversation
I test ads example locally, don't see uncaught errors now |
@@ -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(() => {}, () => {}); |
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.
This just needs a #catch
.
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.
fixed
LGTM. |
@@ -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(() => { |
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.
sorry to ask: didn't we have a test to cover this ?
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.
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
No description provided.