surrealdb / surrealdb.go

SurrealDB SDK for Golang
https://surrealdb.com
Apache License 2.0
232 stars 60 forks source link

fix #119, panic gorilla ws when connection lost. #138

Closed ElecTwix closed 2 months ago

ElecTwix commented 3 months ago

fix #119 instead of panic it will return error when any send function call when connection lost.

ElecTwix commented 3 months ago

TLDR: This pull request aims to address issue #135 without requiring an additional function call.

timpratim commented 2 months ago

Hi @ElecTwix , thank you for the PR. Everything looks great. It would be great if we could add a test case for the Send method in the same PR. Happy to merge the PR then.

ElecTwix commented 2 months ago

It would be great if we could add a test case for the Send method in the same PR.

Hi @timpratim added test named connectionBreakAndClose for test the Send method to checks it's error return. I would like to add tests directly but it require mocks for gorilla itself for make it simpler I came up with this but in my next PRs, I will address this too.

timpratim commented 2 months ago

Thank you @ElecTwix. Appreciate it! Merging the PR.