noisyboiler / wampy

Websocket RPC and Pub/Sub for Python applications and microservices
Mozilla Public License 2.0
127 stars 24 forks source link

Error when transferring big, really big strings #100

Closed sergio-bershadsky closed 4 years ago

sergio-bershadsky commented 4 years ago

Trying to transfer 178363 bytes length json RESULT message. wampy client throws UnicodeDecodeError.

At the same time Autbahn's component implementation works as expected.

Traceback (most recent call last):
  File "src/gevent/greenlet.py", line 854, in gevent._greenlet.Greenlet.run
  File ".../lib/python3.7/site-packages/wampy/session.py", line 165, in connection_handler
    message = frame.payload
  File "../lib/python3.7/site-packages/wampy/transports/websocket/frames.py", line 109, in payload
    payload_str = self.raw_bytes[6:].decode('utf-8')
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb9 in position 2: invalid start byte
noisyboiler commented 4 years ago

Hi @sergio-bershadsky

Sorry for the long delay responding to you. Many thanks for raising this.... and I knew this day would one day come! wampy hasn't yet implemented messaging across multiple frames and I'm guessing that in your logs you can find this message: https://github.com/noisyboiler/wampy/blob/master/wampy/transports/websocket/frames.py#L135

I'm really pleased that you are using wampy, and I'm sorry that you have discovered this deficiency.

I'll be putting on my wampy hat again mid-July when I have some time off for the virtual EuroPython. Feel free to chip in with the required enhancement in the meantime, otherwise, I'm too busy with the day job to look at this now, sorry.

But it will be addressed.

Thanks again.

noisyboiler commented 4 years ago

@sergio-bershadsky looking at sorting this out this coming week.

noisyboiler commented 4 years ago

@sergio-bershadsky the missing line: https://github.com/noisyboiler/wampy/pull/103/files#diff-d8f8d4835f653e4ecf2216eb14e71c0bR217