Skip to content

[Bug] stripSequenceSets crashes on funnel nodes with undefined children (v2.9.87) #39

Description

@elPorcharo

Version

2.9.87

Context

Funnel builder — saving a sequence that contains a conditional node (funnel_condition) followed by a "Wait for tag" node on one of its branches.


Description

stripSequenceSets in start.js iterates recursively over funnel sequence nodes. When it encounters a node with action_name === "funnel_condition", it unconditionally accesses t.children.no and t.children.yes without checking whether t.children is defined:

stripSequenceSets: function(t) {
    var e = this;
    return this.each(t, function(t) {
        "send_custom_email" == t.action_name
            ? t = e.stripEmailSequence(t)
            : "funnel_condition" == t.action_name && (
                t.children.no = e.stripSequenceSets(t.children.no),
                t.children.yes = e.stripSequenceSets(t.children.yes)
            )
    }), t
}

Nodes that are not send_custom_email or funnel_condition but appear nested inside a conditional branch (e.g. wait_for_tag) can have children as undefined in their serialized structure. The recursive call passes these nodes back into stripSequenceSets, which on the next iteration attempts to access .no on an undefined children property.


Error

TypeError: can't access property "no", t.children is undefined
    stripSequenceSets start.js:2

Steps to Reproduce

  1. Create a funnel with a funnel_condition node.
  2. On either the Yes or No branch, add a Wait for tag action.
  3. Click Save.

Expected Behavior

The funnel saves without errors.

Actual Behavior

TypeError is thrown in stripSequenceSets and the save fails.


Workaround

Adding a guard on t.children before accessing its properties resolves the issue:

"funnel_condition" == t.action_name && t.children && (
    t.children.no = e.stripSequenceSets(t.children.no),
    t.children.yes = e.stripSequenceSets(t.children.yes)
)

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