Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

handle errors on activities tab periodic updates

Bruno Pagno96870b0127ab
diff --git a/frontend/src/app/core/turbo/turbo-requests.service.ts b/frontend/src/app/core/turbo/turbo-requests.service.ts
index 0c8ab601d49..41d98ea6da0 100644
--- a/frontend/src/app/core/turbo/turbo-requests.service.ts
+++ b/frontend/src/app/core/turbo/turbo-requests.service.ts
@@ -23,10 +23,14 @@ export class TurboRequestsService {
}));
})
.then((result) => {
- // the result may contain a primer error banner if any server side error appeared
- // thus we need to render the html even for non-ok responses
- renderStreamMessage(result.html);
- // after rendering the html, check if the response and throw an error if it's not ok
+ const contentType = result.response.headers.get('Content-Type') || '';
+ const isTurboStream = contentType.includes('text/vnd.turbo-stream.html');
+
+ // only render the stream message if we are in a turbo stream response
+ if (isTurboStream) {
+ renderStreamMessage(result.html);
+ }
+
if (!result.response.ok) {
throw new Error(result.response.statusText);
} else {