iframe-resizer icon indicating copy to clipboard operation
iframe-resizer copied to clipboard

A mutationObserver event triggers an endless reset loop

Open lucavb opened this issue 2 years ago • 3 comments

Hello,

this package is used in our confluence through Scroll Documents for Confluence and it seems that there is a potential infinite loop? I cannot really say whether that is intended or not but it feels odd?

Any how the order is the following

  • child sends the parent a mutationObserver event
  • parent does not have a specific case here and so stumbles into the default case
  • parent sends the client a reset event
  • child sends the parent a resetPage event
  • parent does not have a mapping for this either and sends another reset event
  • repeat the previous two steps indefinitely

I've attached a screenshot of what the communication then looks like

reset-loop

Side note this also means that scrollTo is being called every second or so. And also the version our plugin uses is somewhat outdated, so it is entirely possible that you fixed this (if it is a bug) in the meantime.

lucavb avatar Apr 13 '23 07:04 lucavb

This sounds like you have miss matched version on the library in the iframe and the parent page. Normally this should still work ok, but in this case I think you need to upgrade so that they at least match.

davidjbradshaw avatar May 28 '23 22:05 davidjbradshaw

Hmm, okay this came bundled with a Confluence plugin. We are not using it directly.

lucavb avatar Jan 27 '24 10:01 lucavb

I think you need to talk to them to see how they managed to do this. Not much I can suggest and this has never come up before.

davidjbradshaw avatar Jan 29 '24 09:01 davidjbradshaw