Skip to content

fix(devtools): avoid mutating recorded frames when merging a frame range - #71374

Draft
MeAkib wants to merge 1 commit into
angular:mainfrom
MeAkib:devtools/frame-merger-mutation
Draft

MeAkib wants to merge 1 commit into
angular:mainfrom
MeAkib:devtools/frame-merger-mutation

Conversation

@MeAkib

@MeAkib MeAkib commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

When a later frame has a directive that the first selected frame doesn't, mergeFrames added that frame's directive object to the merged result by reference. Merging the next frame then added its timings into the recorded frame, so selecting three or more frames inflated the stored change detection and lifecycle times, and they grew each time the range was selected again.

Copy the directive before adding it to the merged result.

Tested by adding a spec that merges three frames and checks that the input frames are unchanged.

When a later frame has a directive that the first selected frame doesn't,
`mergeFrames` added that frame's directive object to the merged result
by reference. Merging the next frame then added its timings into the
recorded frame, so selecting three or more frames inflated the stored
change detection and lifecycle times, and they grew each time the range
was selected again.

Copy the directive before adding it to the merged result.

Tested by adding a spec that merges three frames and checks that the
input frames are unchanged.
@ngbot ngbot Bot added this to the Backlog milestone Oct 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant