openproject icon indicating copy to clipboard operation
openproject copied to clipboard

[FIX] Add Turbo Stream support for health status report

Open shiroginne opened this issue 2 months ago • 3 comments

Ticket

N/A

What are you trying to accomplish?

Introduces Turbo Stream responses to the health status controller and views, enabling dynamic updates of the health status report without a full page reload. Refactors the view logic into a partial for reuse and adds a Turbo Stream template for report updates.

Before this fix, the report was not showing snow on the page.

Screenshots

Screenshot 2026-01-06 at 15 54 39

Merge checklist

  • [x] Added/updated tests
  • [ ] Added/updated documentation in Lookbook (patterns, previews, etc)
  • [ ] Tested major browsers (Chrome, Firefox, Edge, ...)

shiroginne avatar Jan 06 '26 14:01 shiroginne

I don't quite understand why this fix (especially the introduction of turbo streams) is necessary here.

Normally expected behaviour is that creation of the report should be cached and later requests can read the cache.

In all constellations we should have a single, consistent view of the cache: Either a single process that might hold the cache in memory or (usually in production deployments) multiple processes that share the cache through a common Memcached.

Out of curiosity: Is your setup somewhere in between? E.g. multiple processes, but no Memcached?

NobodysNightmare avatar Jan 06 '26 15:01 NobodysNightmare

Essentially what I'd criticise at some point is that the number of request formats we handle (and behave slightly different for) is steadily increasing here. On the other hand, the problem might be caused by something that threw me off about this implementation from the beginning (and it's not getting better): We misuse the cache in a non-caching way.

If that was the root cause for problems here, we should finally fix that. Either by:

  • using the cache in a caching matter (i.e. read_from_cache_or { read_fresh_and_expensive })
  • Storing the health check results persistently in the database, so that old reports can be accessed at any time and are not subject to cache inconsistency or cache eviction

NobodysNightmare avatar Jan 06 '26 15:01 NobodysNightmare

Introduces Turbo Stream responses to the health status controller and views, enabling dynamic updates of the health status report without a full page reload.

Turbo Frames is enabled for most pages, so we're not technically doing a full page load. This page is effectively doing the same things as Turbo Frames (just minus the left-hand menu) but adds extra complexity.

Turbo Streams should generally be reserved for "surgical" updates to smaller regions of the page, e.g. a Title or Status button.

myabc avatar Jan 06 '26 18:01 myabc