WebsocketPromisify icon indicating copy to clipboard operation
WebsocketPromisify copied to clipboard

The 'send' log only logs the original data you send and doesnt take into consideration possible 'encode' changes

Open dagadbm opened this issue 3 years ago • 4 comments
trafficstars

Since we can modify the sent data using the encode/decode functions it would be nice if the logging logged what ends up actually being after the config.encode() function is being run

https://github.com/houd1ni/WebsocketPromisify/blob/0a898be4b31f24fc44e951081640c5b485eacd2c/src/WS.ts#L103

dagadbm avatar Dec 07 '21 09:12 dagadbm

Here is another way in which the send is also not really correct:

image

The message hasnt been sent yet because ws is null so it kind of leads to errors

dagadbm avatar Dec 07 '21 11:12 dagadbm

Originally, encode and decode were added because of large data chunks (not text!) were packed very specifically. Before the addition, it could lead to noticeable performance issues. It also even been a thought that it's too heavy load on a dev machine sometimes and might become partially hidden because of showing the messages every time.

houd1ni avatar Dec 07 '21 16:12 houd1ni

This will be updated after https://github.com/houd1ni/WebsocketPromisify/issues/37 is done.

houd1ni avatar Feb 28 '23 04:02 houd1ni