Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I am currently tracking down an issue with infinite scrolling on an AlfFilteredList in an Aikau-ified Surf component (not a hybrid or full page web script - in this case I am replacing the people-finder component in the page of that name via a sub-component) using the InfiniteScrollingService. During debugging I noticed that immediately after the initial page load and a single scroll action, the PubSubLog was extremely slow to open. Looking for ALF_EVENTS_SCROLL revealed that the payload published contains a reference to the window object which is currently not detected in the sanitation code. As a result, the entire window object and all the data accessible through it have been recursively processed. This even included data from localStorage, which - among other data - contained a very large script I recently executed via the JavaScript console.
This PR adds an extra check to avoid processing the window object. Additionally, this PR improves on the check for widget instances - the _attachPoints previously checked originate from the _AttachMixin that not all widgets may have mixed in (at PRODYNA I avoided that mixin due to the overhead it introduced in complex widget structures). Finally, I added a check for any services that may be reference in payload in a similar manner to the check for widget instances.
Apply these changes to my instance dramatically improved the "snappiness" of the PubSubLog after long durations of scroll testing.