SandboxCase.Sandbox.Hook (sandbox_case v0.4.0-rc1)

Copy Markdown View Source

LiveView on_mount hook that propagates test sandbox state from the test owner process to WebSocket-connected LiveView processes.

Reads the owner PID from the user-agent connect_info (encoded by Phoenix.Ecto.SQL.Sandbox) and propagates Ecto sandbox access, Mimic/Mox stubs, Cachex sandbox, and FunWithFlags sandbox.

Uses $callers for Ecto instead of allow/3 to avoid deadlocks with Cachex Courier workers (see Propagator for details).

Summary

Functions

on_mount(atom, params, session, socket)