Uploaded image for project: 'Addon Channel Manager'
  1. Addon Channel Manager
  2. CHANNELMGR-861

[Forward-port to master] - MutationObserver in OverlaySyncService should filter out duplicate callbacks

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: 4.0.1, 4.1.0
    • Fix Version/s: 4.1.0
    • Labels:
      None
    • Similar issues:
    • Story Points:
      3
    • Processed by team:
      Tiger
    • Sprint:
      Tiger Sprint 139

      Description

      The current DOM MutationObserver in the OverlaySyncService can easily lead to infinite loops. For example, when a website has a resize callback that mutates the DOM (e.g. set the height of an element) this will trigger the MutationObserver callback, which in turns re-calculates the height of the iframe and subsequently triggering another resize event in the website, starting the infinite loop.

      After trying out different solutions (simply checking if the width/height of the site has changed, or fixing the script in the website to only cause a DOM mutation when necessary) it became clear that the list of MutationRecords provided by the MutationObserver is always the same when we are in the loop. This allows for a generic fix that only triggers a redraw in the ChannelManager overlay if the current list of MutationRecords differers from the previous list.

      For a more thorough explanation, please see the linked HIPCON-2018 issue.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                asolod Andrey Solod
                Reporter:
                tjeger Tobias Jeger
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: