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

ResizeObserver loop completed with undelivered notifications #1339

Open
KoanLeeroy opened this issue Sep 23, 2024 · 4 comments
Open

ResizeObserver loop completed with undelivered notifications #1339

KoanLeeroy opened this issue Sep 23, 2024 · 4 comments
Assignees
Labels
Browser Issue This issue is due to limitations in current browsers and has no simple work around

Comments

@KoanLeeroy
Copy link

Describe the bug
Just implemented 5.3.1 of the library. We are seeing daily unhandled exceptions thrown by Safari with the message: 'ResizeObserver loop completed with undelivered notifications'.

We do not see the issue ourselves, despite using the same browser, on the same site(s) that are logging this issue, so cannot reproduce, can Sentry is capturing the issue.

Screenshots
image
image

Desktop (please complete the following information):

  • OS: iOS
  • Browser safari
  • Version: latest
@davidjbradshaw
Copy link
Owner

This seems to be a bug in Safari, that does not actually impact how iframe-resizer works. It's basically objecting to the fact the code runs so fast, that it has resized the iframe on the parent page within the same animation frame that the change in content size was detected.

It's their to reduce the impact of unintended loops locking up the browser, but that is not an issue here, as the second time it fires will trigger no action, as the iframe now matches the content size. Further to this iframe-resizer throttles all event handlers through the same code path, so it will only ever check content size once per animation frame anyway.

Looking at Sentry's own page about this warning, they basically recommend disabling the message.

Can I ask are you using cross domain or same domain iframes? I'm wondering if this is only an issue with same domain.
Also have you seen this issue in earlier versions of iframe-resizer? Or is this the only version you have used?

Having just upgraded to Safari 18, I'm able to now see this warning message on the examples page of iframe-resizer.com.

A possible workaround to this would be to use requestAnimationFrame when the parent receives a message from the child to resize, but that comes at the cost of making animated content resizes slightly choppy. It also should not be necessary, as all resize events run through the same code pipeline and are already throttled to once per frame.

@davidjbradshaw
Copy link
Owner

I should also note that on the examples page, I'm deliberately causing an infinite resize loop with the CSS animation. On more normal pages I'm not seeing the warning message and it could also be that some of your users have a browser extension that is causing the issue.

@KoanLeeroy
Copy link
Author

The iframes are cross-domain, and this is our first use of your code, so no prior versions/regressions known.

All I can safely say is that I do not see any perceived issued when I browse to the site in question, using the same device, OS and browser version as the user. I would be happy to pass to you a sample couple of sites that have reported the error, but would prefer to do so privately, somehow. Let me know if you are happy to do this and how we might be able to.

Am happy in principle to instruct Sentry to ignore these exceptions, but wanted to raise it for awareness.

@davidjbradshaw
Copy link
Owner

You can send stuff privately to info@iframe-resizer.com, I’m interested to take a look.

Do you see this warning on the examples page?

@davidjbradshaw davidjbradshaw added the Browser Issue This issue is due to limitations in current browsers and has no simple work around label Sep 24, 2024
@davidjbradshaw davidjbradshaw self-assigned this Sep 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Browser Issue This issue is due to limitations in current browsers and has no simple work around
Projects
None yet
Development

No branches or pull requests

2 participants