Skip to content

Revert "Merge pull request #4166 from Tyriar/event_with_emitter"#4177

Merged
Tyriar merged 1 commit intoxtermjs:masterfrom
Tyriar:tyriar/revert_events
Oct 6, 2022
Merged

Revert "Merge pull request #4166 from Tyriar/event_with_emitter"#4177
Tyriar merged 1 commit intoxtermjs:masterfrom
Tyriar:tyriar/revert_events

Conversation

@Tyriar
Copy link
Copy Markdown
Member

@Tyriar Tyriar commented Oct 6, 2022

This reverts commit d22f7c9, reversing changes made to 1f8e6f0.

When discussed with the VS Code team they pointed out this is a bit dangerous exposing the emitters publicly everywhere. Reverting as I was convinced safety beats convenience.

@Tyriar Tyriar added this to the 5.1.0 milestone Oct 6, 2022
@Tyriar Tyriar self-assigned this Oct 6, 2022
@Tyriar Tyriar enabled auto-merge October 6, 2022 16:51
@Tyriar Tyriar merged commit 3ec0894 into xtermjs:master Oct 6, 2022
@Tyriar Tyriar deleted the tyriar/revert_events branch October 6, 2022 17:18
@jerch
Copy link
Copy Markdown
Member

jerch commented Oct 6, 2022

@Tyriar How is that more dangerous than the current approach? I mean a serious attacker can just follow the internal symbols to get down to the emitters anyway? (Btw thats basically what I did during the listener debugging to get a hold if their root...)

@Tyriar
Copy link
Copy Markdown
Member Author

Tyriar commented Oct 6, 2022

It's not a security issue, but a separation of concerns issue. The risk is too great that some commit would be made that creates an instance of a class class but not assign it to a variable typed with the interface (not the class) which would expose fire.

@jerch
Copy link
Copy Markdown
Member

jerch commented Oct 6, 2022

Ah ok, yeah this newer approach mixed functionality into one thingy, that needs a certain usage pattern. I tend to treat those things as "if in doubt: explicit is better than implicit".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants