Skip to main content

try_execute_client_event_handler

Function try_execute_client_event_handler 

Source
pub async fn try_execute_client_event_handler(
    state: &AppState,
    client_id: ClientId,
    event_type_id: &str,
    event_description: &str,
    event_data: Option<Value>,
) -> Result<ClientEventHandlerResult>
Expand description

Check and execute the configured event handler for a client event.

The client mirror of try_execute_event_handler. Reads the client’s own event_handler_config (stored since forever, dispatched from nowhere until now), matches first-match-wins, and:

  • Static — interpolates {{event.field}} references and returns the rendered actions. An unresolvable reference is a hard Err, same as the server path.
  • Script — runs the script with a client-shaped ScriptInput (client set, server absent) and returns its actions. A script failure falls back to the LLM, same as the server path.
  • Llm { instruction } — falls back with the per-event instruction.