-
Notifications
You must be signed in to change notification settings - Fork 29
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 Case Event List Item and Event Form List Item templates from rerendering constantly creating DOM Nodes leak #2000
Comments
We might be able to prevent this by disabling change detection on those Angular components with this strategy. However, that might be too high level, this is that particular template variables going through pipes keep rerendering. That unsanitizeHTML pipe might be the problem because it keeps piping out at this interval. |
Amazing Sleuthing, @rjsteinert ! |
Thanks @mfinholt! Turning off Angular's change detection is doing the trick! No more flashing changes in the DOM there. However DOM Nodes are still going up because of another component we need to turn off change detection on... The Case Component handling that description of the case. Meanwhile over on the list of Event Forms, the change detection seems to be getting more aggressive. It's flashing multiple times a second as opposed to the every 5 seconds we saw before. |
Oops, it's not the "optimal DOM nodes" level. The recommendation states 1,500 is optimal, we're at 6,200. But at least much better than the 132,000 captured in one of the gifs above. |
…-and-event-form-dom-leak (for #2000) Fix DOM leaks in components Case, CaseEventListItem, and EventFormListItem
Fix confirmed by Sante Mali. |
Stashing some docs on finding DOM node leaks. I didn't end up finding them useful as I think they are outdated but worth keeping around in case we can find updated docs in the future. |
If you load up a case with a couple of events, you'll notice about every 5 seconds the Case Event List Item and Event Form List rerender resulting in an ever growing DOM nodes that take up memory. Note the flashing parts of the DOM here indicating a change in the DOM... When nothing has actually changed in the Angular component's data.
I placed a debugger statement in those components, the function to actually render is not getting called. It's just the Angular template recreating those things at a constant interval. Those things created are actually template variables of unsanitized HTML. I imagine this recreation would also be true for text strings. Perhaps Angular is thrashing on HTML that when it renders changes itself and it keeps trying t change it back to the original value?
The text was updated successfully, but these errors were encountered: