diff --git a/src/App/IPC.purs b/src/App/IPC.purs index 52514c2..6323613 100644 --- a/src/App/IPC.purs +++ b/src/App/IPC.purs @@ -49,10 +49,12 @@ utf8ToArrayBuffer s = Builder.execPutM do toIPC :: String -> Effect ArrayBuffer toIPC = utf8ToArrayBuffer --- TODO: this code shouldn't handle parse errors. fromIPC :: ArrayBuffer -> Effect (Either ParseError String) fromIPC = arrayBufferToUtf8 +-- TODO: this code doesn't verify the actual length of the message. +-- An inconsistent length would be an error sign, message should be discarded +-- and the connection should be closed. arrayBufferToUtf8 :: ArrayBuffer -> Effect (Either ParseError String) arrayBufferToUtf8 arrayBuffer = do textDecoder <- TextDecoder.new UtfLabel.utf8