footprintjs - v11.2.0
    Preparing search index...

    Function isFlowEvent

    • Discriminator for the union payload types on CombinedRecorder's shared methods (onError, onPause, onResume). Returns true if the event was emitted from the control-flow channel (FlowRecorder).

      1. Explicit channel field first (backlog B3): every engine-dispatched shared-method event is stamped channel: 'flow' (control-flow) or channel: 'scope' (data-flow) at construction. This is the positive, schema-robust signal — it survives wrappers that add/strip fields.
      2. Legacy fallback for unstamped events (consumer-fabricated tests, persisted traces from <9.2): scope-channel events extend RecorderContext, which carries pipelineId; flow-channel events do not. The flow variant is detected by the ABSENCE of pipelineId — schema-stable as long as scope events continue to extend RecorderContext, but fragile against field-stripping wrappers, which is why the explicit discriminant now exists.

      Type Parameters

      • T

      Parameters

      • event: T

      Returns event is Exclude<T, { pipelineId: string }>

      onError: (e) => {
      if (isFlowEvent(e)) {
      // Narrowed to FlowErrorEvent: has stageName, message, structuredError
      } else {
      // Narrowed to ErrorEvent: has error, operation, key?
      }
      }