This commit resolves a regression introduced by commit 9c3ec3c7.
We still might want to remove this false data from our database, which is still pending.
The previous solution worked, but always queried all ErrorTemplateAttributes, even if there was no match of the ErrorTemplate. This solution resolves this issue and still benefits from less SQL queries.
Even though we can check the health of the runner management, we would like to ensure an external health check validates the availability of all required services.
We previously optimized the SQL queries, so that anonymous users without any cookie sent no longer result in a database query. This is generally awesome, but it also allows our health check monitoring to pass even when no database connection can be established.
While the code gets more complex, the new query will first filter all relevant RfCs and only use the `with_last_activity` scope for the current page.
Using `distinct` in the policy is not required (no duplicated RfCs), but causes issues for the ordering otherwise. Therefore, it is removed.
Fixes CODEOCEAN-J2
Previously, we were always fetching files, even if not required (e.g., for score runs). Now, we reduce the number of file listings and use a dedicated callback.
Previously, an exception was caused by the tubesock gem but not sent to Sentry. This caused errors not to bubble up correctly but rather kill the current thread, leaving the user with a generic "WebSocket connection not established" message.
Probably, this should be removed when updating the WebSocket implementation.
When a file cannot be retrieved any longer, we send a redirect to the previous locations. As we usually enable a different render host, Rails sees this redirect as a redirect to another host (from the render host to the main CodeOcean host).
An invalid XML response may be returned if the LTI provider is unavailable and cannot handle our request. We decided against logging in Sentry as this affects a third party functionality we cannot fix ourselves.
Fixes CODEOCEAN-G2