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

BrowserWebSocketClientAdapter: Don't throw on unknown message type #227

Merged

Conversation

HerbCaudill
Copy link
Collaborator

This prevents an auth provider from sending auth messages.

It's not the network adapter's place to have opinions about messages that it doesn't handle internally -- it should just emit them and let listeners decide what to do with them.

It is the NetworkSubsystem's job to do this check, and it already does:

networkAdapter.on("message", msg => {
if (!isValidRepoMessage(msg)) {
this.#log(`invalid message: ${JSON.stringify(msg)}`)
return
}

@HerbCaudill HerbCaudill requested review from pvh and alexjg November 8, 2023 14:17
@HerbCaudill HerbCaudill merged commit b10e747 into main Nov 8, 2023
2 of 3 checks passed
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