Turbo Streams 7.2: silent ignore on missing targets – should we add fail_on_missing?
0 reputation · 01 May 2025, 19:44 UTC
Unresolved behavior
The current Turbo Streams implementation in Rails 7.2 silently ignores actions whose target attribute does not match an element in the client DOM. No error is thrown, and the page remains unchanged.
Developers face a design decision: continue relying on this silent‑ignore semantics or implement a new configuration that raises an error or triggers a callback when a target is missing. The lack of an official option forces teams to add custom checks in JavaScript or server logs, complicating integration tests that mock WebSocket or SSE streams.
Key constraints include backward compatibility with existing production deployments, the need for deterministic test outcomes, and the absence of a documented change‑log entry that clarifies whether silent ignore is intended to persist.
What are the trade‑offs of maintaining silent ignore versus providing a fail‑on‑missing mode? How would a new configuration affect existing Turbo Streams payloads and client‑side listeners? What testing strategies can reliably surface missing‑target issues in a production‑like environment?