Skip to content

fix(core): prevents event replay from being called on comment nodes#60130

Closed
thePunderWoman wants to merge 2 commits intoangular:mainfrom
thePunderWoman:replay-comment
Closed

fix(core): prevents event replay from being called on comment nodes#60130
thePunderWoman wants to merge 2 commits intoangular:mainfrom
thePunderWoman:replay-comment

Conversation

@thePunderWoman
Copy link
Copy Markdown
Contributor

In some rare cases with directives, it is possible that the stash function might be called on a comment node. This actually verifies that the node is an element and exits otherwise. A second commit also cleans up the event replay tests to use all the same utilities as hydration tests.

fixes: #60070

Does this PR introduce a breaking change?

  • Yes
  • No

@angular-robot angular-robot bot added the area: core Issues related to the framework runtime label Feb 26, 2025
@ngbot ngbot bot added this to the Backlog milestone Feb 26, 2025
@angular angular deleted a comment from gemini-code-assist bot Feb 26, 2025
@thePunderWoman thePunderWoman added action: review The PR is still awaiting reviews from at least one requested reviewer target: patch This PR is targeted for the next patch release labels Feb 26, 2025
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add nodeType: number to RNode ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good question, but I think it can be answered outside of this PR.

@thePunderWoman thePunderWoman force-pushed the replay-comment branch 2 times, most recently from 4587297 to 0a5f8a9 Compare February 26, 2025 21:44
@thePunderWoman thePunderWoman force-pushed the replay-comment branch 2 times, most recently from b0b1069 to b1344d5 Compare February 26, 2025 22:26
@thePunderWoman thePunderWoman force-pushed the replay-comment branch 2 times, most recently from 6757f62 to bfd9435 Compare February 27, 2025 15:24
This updates the event replay tests to make them share the structure and utility functions used by hydration tests. This also resolves some soft errors in the event replay tests.
In some rare cases with directives, it is possible that the stash function might be called on a comment node. This actually verifies that the node is an element and exits otherwise.

fixes: angular#60070
@AndrewKushnir AndrewKushnir added action: presubmit The PR is in need of a google3 presubmit and removed action: review The PR is still awaiting reviews from at least one requested reviewer labels Feb 27, 2025
@thePunderWoman thePunderWoman added action: merge The PR is ready for merge by the caretaker and removed action: presubmit The PR is in need of a google3 presubmit labels Feb 27, 2025
@mmalerba
Copy link
Copy Markdown
Contributor

This PR was merged into the repository by commit 7ab0a8d.

The changes were merged into the following branches: main, 19.2.x

mmalerba pushed a commit that referenced this pull request Feb 28, 2025
This updates the event replay tests to make them share the structure and utility functions used by hydration tests. This also resolves some soft errors in the event replay tests.

PR Close #60130
mmalerba pushed a commit that referenced this pull request Feb 28, 2025
…60130)

In some rare cases with directives, it is possible that the stash function might be called on a comment node. This actually verifies that the node is an element and exits otherwise.

fixes: #60070

PR Close #60130
@mmalerba mmalerba closed this in 8a73327 Feb 28, 2025
mmalerba pushed a commit that referenced this pull request Feb 28, 2025
…60130)

In some rare cases with directives, it is possible that the stash function might be called on a comment node. This actually verifies that the node is an element and exits otherwise.

fixes: #60070

PR Close #60130
@angular-automatic-lock-bot
Copy link
Copy Markdown

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Mar 31, 2025
@thePunderWoman thePunderWoman deleted the replay-comment branch May 23, 2025 13:47
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker area: core Issues related to the framework runtime target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

EventReplay throws with a Directive HostListener on a ng-container

4 participants