-
Notifications
You must be signed in to change notification settings - Fork 49
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
Increasing the size of the WebSocket #70
base: main
Are you sure you want to change the base?
Conversation
…pport WebSocket only handles 1MB of data and I'm getting this error message `sent 1009 (message too large); no closed frames received` when I try to do a `SELECT * FROM my_table` when `my_table` had more than 1 MB of data. Adding the `max_size` variable to the `Surreal` constructor class and its `connection` method solves the problem.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just wanted to share my personal opinions, thanks for your work :)
else: | ||
self.url |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Else block seems doing nothing, is there any reason why it is here?
# helping people when they type the url in wrong | ||
if "http" in self.url: | ||
self.url = self.url.replace("http://", "ws://") | ||
elif "https" in self.url: | ||
self.url = self.url.replace("https://", "wss://") | ||
if "/rpc" not in self.url: | ||
self.url = "".join([self.url, "/rpc"]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may lead some unexpected behaviour:
url = "https://meppu.boo"
if "http" in url:
print("something is wrong")
elif "https" in url:
print("still not a good way to do it")
# prints "something is wrong"
The easiest solution is of course just switching condition's order and appending ://
, But if something like this needs to be implemented, using something like urllib would be a better choice: https://docs.python.org/3/library/urllib.parse.html
The default value of 1MB was being set in the connect method, which made the value passed to the surreal class constructor invalid. That is, every time the connect method was called but did not receive any value from its `max_value` variable, it would set the default value of 1 MB, overwriting the value set at object initialization.
Hi, I noticed that the latest commit appears to be unrelated to the feedback I provided in my previous review. Please let me know if you have any questions about the feedback I provided or if you'd like any clarification on specific points. I want to clarify that I don't have merge access and my initial review was offered from a personal standpoint to provide insights and suggestions. |
What is the motivation?
WebSocket only handles 1MB of data and I'm getting this error message
sent 1009 (message too large); no closed frames received
when I try to do aSELECT * FROM my_table
whenmy_table
had more than 1 MB of data.Type of Change
What does this change do?
These changes allow the user to specify what is the max size of the data that the WebSocket connection to the SurrealDB will be capable to handle.
What is your testing strategy?
This script will print on the terminal all data from your table, but if you remove the
max_size
parameter fromconnect
method the max size handle will be only 1 MB as default.Is this related to any issues?
No
Have you read the Contributing Guidelines?