Skip to content

TypeError when adding condition block inside condition branch via search #40

Description

@zackkatz

TLDR: Check Conditions aren't designed to be nested inside other Check Condition branches, but the search box in the block chooser bypasses the filter that prevents this — leading to a crash on save.

Video

https://www.loom.com/share/6205a8dc2bdd4edca6ece53388fd5b45

Bug

When inside a Check Condition branch (yes/no), using the search box in the block chooser exposes Check Conditions that aren't available through normal browsing. Adding one and then saving triggers:

TypeError: undefined is not an object (evaluating 't.children.no')

Stack trace points to stripSequenceSetssaveFunnelSequences during save.

Steps to Reproduce

  1. Create or edit an automation funnel
  2. Add a Check Condition at the top level
  3. Inside the Yes or No branch, click "Add Action"
  4. In the block chooser drawer, type in the search box (any text)
  5. A "Conditionals" section appears with Check Conditions
  6. Add a Check Condition
  7. Click Save

Cause

The block-choice component correctly filters out Check Conditions when choice_context is "child" — but the searchBlock watcher sets selectType to "all", which bypasses this filter:

// Watcher switches to "all" on any search input
searchBlock: function(t) { t && (this.selectType = "all") }

In "all" mode, the choice_context check isn't applied, so Check Conditions appear in the results.

When the user adds one, children: {yes: [], no: []} is never initialized on the block (the child-blocks addBlock doesn't include this initialization, unlike the parent component's addBlock). Then stripSequenceSets tries to access t.children.no on save and crashes.

Impact

  • Immediate: JS crash prevents saving the funnel
  • Data risk: If a user manages to work around the crash, saveChildSequences in FunnelHelper.php doesn't recurse into nested Check Conditions, so inner branch children would be silently lost

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions