Commit Graph

18 Commits

Author SHA1 Message Date
515a81537c Connection::Buffer: Prevent modification of line breaks in quotes
After splitting the messages received into lines, we could still have a line break within quotes. Since we just want to modify terminating line breaks, we change the recognition accordingly.
2023-09-24 15:42:26 +02:00
64c1a1cb6f Connection::Buffer: Handle Python doc string correctly
In Python, a so-called doc string consists of a string encoded in three quote (starting and ending with """ or '''). These strings were not yet recognized correctly, so that line breaks there would cause further trouble with recognizing individual lines (which is important for the linter translation).
2023-09-24 15:38:58 +02:00
968fd5b864 Connection::Buffer: Fix recognition of incoming CLRF line endings
Previously, a message received with CRLF line endings was (incorrectly) converted to CRCRLF line endings (i.e., from \r\n to \r\r\n). Then, the splitting in individual lines could generate an "empty" line, just containing the newly-added CR line ending \r.
2023-09-24 14:10:06 +02:00
03637b3185 Buffer: Buffer messages with incomplete quotes
If a non-JSON message received contains quotes and is cut off weirdly, the following message might "quote" the line breaks. Then, we have an issue and cause \r\n\n for the further processing within the CodeOcean backend.
2023-09-20 22:35:26 +02:00
b5cb5c16dd Buffer: Split only complete lines ending with \r\n
This change is required for Turtle output generated by the Python environment. Otherwise, drawing some images could add empty new lines (in the browser), since the original JSON message got split between the ending \r\n characters.
2023-09-20 22:33:59 +02:00
bcdc71021e Fix Rubocop offenses 2023-06-11 20:46:45 +02:00
8d8bf5ef29 Connection::Buffer: Fix bug for incomplete lines
* Introduce (temporary) conversion to CRLF-line endings before processing and splitting the output
* (Partially) revert previous changes
2022-04-25 17:53:08 +02:00
902d09b3fa Connection::Buffer: Allow additional, single new lines for AWS 2022-04-24 19:34:53 +02:00
591d520e26 Connection::Buffer: Improve performance for deleting \r suffix 2022-04-24 19:00:02 +02:00
c5f0189859 Connection::Buffer: Remove duplicated new line character
"a\r".gsub(/\r?$/, "\n") ==> "a\n\n"
2022-04-24 18:57:33 +02:00
35454836c8 Allow \r\n and \n line breaks for Connection::Buffer
* Nomad sends CRLF-separated lines
* AWS sends LF-separated lines
2022-04-24 18:26:05 +02:00
18daa1c998 Enable image preview in STDOUT 2022-03-02 11:44:48 +01:00
e34656eb0f Modify buffer line breaking behavior
* This is based on Sentry issue CODEOCEAN-5W (linter translation failing due to \r in output)
* We cannot keep all "\r" messages but we must not forward the "\r" if it is a single message received after a valid JSON
2021-11-15 00:30:32 +01:00
7d032e5c0d Buffer: Prevent replacement of "\r" message 2021-11-08 23:33:37 +01:00
9a541998e4 Optimize RegEx 2021-11-06 02:15:03 +01:00
6ff14d6fc7 Connection Buffer: Replace \r in run and score output with \n 2021-11-01 17:13:14 +01:00
1891cdd69c Add check whether buffer is empty 2021-11-01 17:13:00 +01:00
a074a5cb0d Add buffering to output received from runner 2021-11-01 17:12:58 +01:00