Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix interrupting with background flows #186

Merged
merged 1 commit into from
Jan 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions core/tasks/handler/contact_tasks.go
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ func HandleChannelEvent(ctx context.Context, rt *runtime.Runtime, eventType mode
}
}

sessions, err := runner.StartFlowForContacts(ctx, rt, oa, flow, []*models.Contact{modelContact}, []flows.Trigger{trig}, hook, true)
sessions, err := runner.StartFlowForContacts(ctx, rt, oa, flow, []*models.Contact{modelContact}, []flows.Trigger{trig}, hook, flow.FlowType().Interrupts())
if err != nil {
return nil, errors.Wrapf(err, "error starting flow for contact")
}
Expand Down Expand Up @@ -491,7 +491,7 @@ func handleMsgEvent(ctx context.Context, rt *runtime.Runtime, event *MsgEvent) e

// otherwise build the trigger and start the flow directly
trigger := tb.Build()
_, err = runner.StartFlowForContacts(ctx, rt, oa, flow, []*models.Contact{modelContact}, []flows.Trigger{trigger}, flowMsgHook, true)
_, err = runner.StartFlowForContacts(ctx, rt, oa, flow, []*models.Contact{modelContact}, []flows.Trigger{trigger}, flowMsgHook, flow.FlowType().Interrupts())
if err != nil {
return errors.Wrapf(err, "error starting flow for contact")
}
Expand Down Expand Up @@ -599,7 +599,7 @@ func handleTicketEvent(ctx context.Context, rt *runtime.Runtime, event *models.T
return errors.Errorf("unknown ticket event type: %s", event.EventType())
}

_, err = runner.StartFlowForContacts(ctx, rt, oa, flow, []*models.Contact{modelContact}, []flows.Trigger{flowTrigger}, nil, true)
_, err = runner.StartFlowForContacts(ctx, rt, oa, flow, []*models.Contact{modelContact}, []flows.Trigger{flowTrigger}, nil, flow.FlowType().Interrupts())
if err != nil {
return errors.Wrapf(err, "error starting flow for contact")
}
Expand Down
Loading