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

🤫 Add support for passive flows #393

Merged
merged 3 commits into from
Jan 6, 2021
Merged

🤫 Add support for passive flows #393

merged 3 commits into from
Jan 6, 2021

Conversation

rowanseymour
Copy link
Contributor

Not much to do here as we already have the concept of not interrupting sessions from campaign single-message flows

@codecov
Copy link

codecov bot commented Jan 6, 2021

Codecov Report

Merging #393 (cb7a1b6) into master (aa822c6) will decrease coverage by 0.00%.
The diff coverage is 60.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #393      +/-   ##
==========================================
- Coverage   55.03%   55.02%   -0.01%     
==========================================
  Files         113      113              
  Lines        7912     7913       +1     
==========================================
  Hits         4354     4354              
- Misses       2863     2864       +1     
  Partials      695      695              
Impacted Files Coverage Δ
core/models/flows.go 76.19% <0.00%> (-1.86%) ⬇️
core/tasks/ivr/worker.go 41.07% <0.00%> (ø)
core/tasks/starts/worker.go 55.43% <0.00%> (ø)
core/runner/runner.go 46.51% <33.33%> (ø)
core/tasks/handler/worker.go 50.00% <75.00%> (ø)
core/handlers/msg_created.go 75.00% <100.00%> (ø)
core/handlers/msg_received.go 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update aa822c6...cb7a1b6. Read the comment docs.

@@ -226,7 +226,7 @@ func StartFlowBatch(
options := NewStartOptions()
options.RestartParticipants = batch.RestartParticipants()
options.IncludeActive = batch.IncludeActive()
options.Interrupt = true
options.Interrupt = flow.FlowType() != models.FlowTypePassive
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So could still surface exclude_active/include_active in the UI for passive flows.. the flow type only determines whether we interrupt or not if you do include active contacts. Not completely sure that's useful but this leaves the door open.

flows.FlowTypeVoice: IVRFlow,
flows.FlowTypeMessagingOffline: SurveyorFlow,
flows.FlowTypeMessaging: FlowTypeMessaging,
flows.FlowTypeMessagingPassive: FlowTypePassive,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor but wonder if PassiveMessaging might be a bit better? It is still messaging after all. (only say this because the type does still imply the medium, which in this case is still messaging)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

then I start thinking why don't they match the engine types.. why FlowTypeSurveyor over FlowTypeMessagingOffline.. so I convinced myself to just let these match the database codes M, V, P, S

@@ -226,7 +226,7 @@ func StartFlowBatch(
options := NewStartOptions()
options.RestartParticipants = batch.RestartParticipants()
options.IncludeActive = batch.IncludeActive()
options.Interrupt = true
options.Interrupt = flow.FlowType() != models.FlowTypePassive
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternate random idea: FlowType has an Interrupt() on it so this just becomes flow.FlowType().Interrupt()

Just a thought though.

@rowanseymour rowanseymour merged commit bb4e512 into master Jan 6, 2021
@rowanseymour rowanseymour deleted the passive branch January 6, 2021 18:55
rasoro pushed a commit to Ilhasoft/mailroom that referenced this pull request Jan 21, 2025
Update sentry and slog support library
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants