CodyTseng / nostr-relay-tray

a nostr relay for desktop
MIT License
43 stars 3 forks source link

RangeError: Max payload size exceeded #8

Closed cxplay closed 3 months ago

cxplay commented 3 months ago

ref to: https://github.com/websockets/ws/issues/1543

[Window Title]
Error

[Main Instruction]
A JavaScript error occurred in the main process

[Content]
Uncaught Exception:
RangeError: Max payload size exceeded
    at Receiver.haveLength (C:\Users\CXPLAY\AppData\Local\nostr_relay_tray\app-1.2.3\resources\app.asar\node_modules\ws\lib\receiver.js:423:28)
    at Receiver.getPayloadLength16 (C:\Users\CXPLAY\AppData\Local\nostr_relay_tray\app-1.2.3\resources\app.asar\node_modules\ws\lib\receiver.js:374:10)
    at Receiver.startLoop (C:\Users\CXPLAY\AppData\Local\nostr_relay_tray\app-1.2.3\resources\app.asar\node_modules\ws\lib\receiver.js:162:16)
    at Receiver._write (C:\Users\CXPLAY\AppData\Local\nostr_relay_tray\app-1.2.3\resources\app.asar\node_modules\ws\lib\receiver.js:98:10)
    at writeOrBuffer (node:internal/streams/writable:392:12)
    at _write (node:internal/streams/writable:333:10)
    at Writable.write (node:internal/streams/writable:337:10)
    at Socket.socketOnData (C:\Users\CXPLAY\AppData\Local\nostr_relay_tray\app-1.2.3\resources\app.asar\node_modules\ws\lib\websocket.js:1303:35)
    at Socket.emit (node:events:517:28)
    at addChunk (node:internal/streams/readable:335:12)
CodyTseng commented 3 months ago

This is because I have restricted the payload maximum to 128k. You might be trying to insert a huge event.

cxplay commented 3 months ago

This is because I have restricted the payload maximum to 128k. You might be trying to insert a huge event.

You're right, but I have absolutely no idea which event is causing this. Is there any option to stop the warning window from popping up?

CodyTseng commented 3 months ago

You're right, but I have absolutely no idea which event is causing this. Is there any option to stop the warning window from popping up?

You can clone the source code, delete line 143 in main.js, and then package and run it.

cxplay commented 3 months ago

You can clone the source code, delete line 143 in main.js, and then package and run it.

I see.

CodyTseng commented 3 months ago

In the future, I will add a settings panel to allow for setting some restrictions.