Commit Graph

15 Commits

Author SHA1 Message Date
Sebastian Serth
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
Sebastian Serth
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
Sebastian Serth
bcdc71021e Fix Rubocop offenses 2023-06-11 20:46:45 +02:00
Sebastian Serth
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
Sebastian Serth
902d09b3fa Connection::Buffer: Allow additional, single new lines for AWS 2022-04-24 19:34:53 +02:00
Sebastian Serth
591d520e26 Connection::Buffer: Improve performance for deleting \r suffix 2022-04-24 19:00:02 +02:00
Sebastian Serth
c5f0189859 Connection::Buffer: Remove duplicated new line character
"a\r".gsub(/\r?$/, "\n") ==> "a\n\n"
2022-04-24 18:57:33 +02:00
Sebastian Serth
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
Sebastian Serth
18daa1c998 Enable image preview in STDOUT 2022-03-02 11:44:48 +01:00
Sebastian Serth
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
Sebastian Serth
7d032e5c0d Buffer: Prevent replacement of "\r" message 2021-11-08 23:33:37 +01:00
Sebastian Serth
9a541998e4 Optimize RegEx 2021-11-06 02:15:03 +01:00
Sebastian Serth
6ff14d6fc7 Connection Buffer: Replace \r in run and score output with \n 2021-11-01 17:13:14 +01:00
Sebastian Serth
1891cdd69c Add check whether buffer is empty 2021-11-01 17:13:00 +01:00
Sebastian Serth
a074a5cb0d Add buffering to output received from runner 2021-11-01 17:12:58 +01:00