Skip to content
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

Warn/throw on unexpected attach addon socket state #4208

Merged
merged 1 commit into from
Oct 17, 2022

Conversation

Tyriar
Copy link
Member

@Tyriar Tyriar commented Oct 16, 2022

@jerch fixing a random TODO, does this seem reasonable?

@Tyriar Tyriar added this to the 5.1.0 milestone Oct 16, 2022
@Tyriar Tyriar requested a review from jerch October 16, 2022 13:50
@Tyriar Tyriar self-assigned this Oct 16, 2022
Copy link
Member

@jerch jerch left a comment

Choose a reason for hiding this comment

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

LGTM, just a minor comment on CLOSING.

throw new Error('Attach addon was loaded before socket was open');
case WebSocket.CLOSING:
console.warn('Attach addon socket is closing');
return false;
Copy link
Member

Choose a reason for hiding this comment

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

Why not throwing here as well? Would this create race conditions during app shutdown?

Copy link
Member Author

Choose a reason for hiding this comment

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

Was worried about breaking something as we dispose on 'close', not closing. Probably doesn't matter 🤷

@Tyriar Tyriar merged commit 3f12d29 into xtermjs:master Oct 17, 2022
@Tyriar Tyriar deleted the todo_attach_socket branch October 17, 2022 10:50
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.

None yet

2 participants