Previously, an error could occur when creating an RfC. The erroneous behavior was triggered with the following steps:
1. A learner is on the implement page
2. They click on another link to leave the current page
3. Before the new page opens (through Turbolinks), the "request comments" button was hit
4. Still before the new page was visible, a question was entered and the RfC was submitted.
5. The new page opens
6. Creating the RfC was successful, and a code run should be triggered (as well as hiding the question modal etc.)
With this commit, we still allow creating an RfC without error even if the page was left before everything finished.
Fixes CODEOCEAN-FRONTEND-9C
Resolves an issue with a strict CSP disabling inline `data` images. With Shakapacker and our current webpack config, we extract inline `data` images to dedicated files, thus resolving the issue.
Using the JSON representation of the error only works for some errors, whereas others are simply marked with a {}. Still, we attach the JSON representation to the Sentry event captured.
As part of the upgrade process, we need to rework the tracing instrumentation. Now, we are just wrapping all async functions in a new sentry transaction, which will automatically end once the function returns.
Further, the structure of the Sentry packages got reworked, so that we only need a single package by now. This removes the need to group dependabot updates.
Co-authored-by: Jan Graichen <jgraichen@altimos.de>
This refactoring is required for Sentry tracing. It ensures that the respective functions only return as soon as a code execution finished. With this approach, we can then instrument the duration of the functions, so that Sentry spans are created as desired.
Co-authored-by: Jan Graichen <jgraichen@altimos.de>
This code was unintentionally copied over and was never useful (since we won't execute code when submitting a community solution).
Co-authored-by: Jan Graichen <jgraichen@altimos.de>
Previously, we could face (a rare) race condition with the wrong order. This was caused by Turbolinks and our usage of "components" (e.g., the CodeOceanEditor).
It could happen that Turbolinks fired the `turbolinks:load` event, as all XHR requests finished. In the event handler, we sometimes referred to other components. However, those components weren't initialized yet, potentially. This is due to Sprockets concatenating files in alphabetical order, ignoring our component dependencies.
With this commit, we try to specify the required order and thus aim to implement a permanent fix.
Fixes CODEOCEAN-FRONTEND-7W
Fixes CODEOCEAN-FRONTEND-7D
The new architecture memorizes settings (which we mostly did after reading the config so far) and also exposes the resulting file path as well as further settings.
This change is a prerequisite to define a dependency with Sprockets.
- Rather than using a Rails helper, we rely on JsRoutes to provide the route.
- There is no need to remove the events_path if sending events is disabled, so we drop that.
The previous method worked correctly most of the time, but failed to resolve nested files correctly. This prevented Web Workers from functioning as expected.
Manually inserting a codeblock adding three backticks and hitting enter
is not functioning in the ToastUI editor due to an existing bug in the library.
This commit implements a workaround to address the issue.
The editor will now have a default height of 300px but a button will let
the user expand the editor. It will expand it to fit all content (or up
to 400px if the content was not exceeding 300px). In the expanded mode
the editor will keep growing as the user types more content.
The default ToastUI image insertion feature includes both URL and file
upload options. However, file upload functionality isn't supported in
the application. This commit addresses the issue by implementing custom
code to hide the file upload button while preserving the URL insertion
option.
Previously, ProgrammingGroups could have been undefined in rare cases. Therefore, we check whether the variable is properly defined before calling the method.
Fixes CODEOCEAN-FRONTEND-7D
We want to differentiate between those RfCs explicitly marked as solved, those potentially solved since the author reached the maximum score, and those being unsolved where the author has not yet reached the full score yet.