move responsibility of defining a contact priority from ChannelBrokerState to ChannelBroker
ChannelBrokerState should not be deciding how to queue respondents. It's something that's outside it responsibility. The one that knows about respondents is ChannelBroker
Enqueue contacts with priority: :high if surveda has already bothered that respondent
We are checking Stats.attempts :full because
we want to count any mode attempt
we want to consider ivr pending calls as well
When runtime/Session starts a respondent, already adds the mode attempt. This happens before the respondent gets queued to the ChannelBrokerQueue - see runtime/Session.run_flow. This means that for distinguishing respondents that are being queued for the first time or not, we have to check for attempts > 1
Changes
ChannelBrokerState
toChannelBroker
ChannelBrokerState
should not be deciding how to queue respondents. It's something that's outside it responsibility. The one that knows about respondents isChannelBroker
priority: :high
if surveda has already bothered that respondentStats.attempts :full
becauseruntime/Session
starts a respondent, already adds the mode attempt. This happens before the respondent gets queued to theChannelBrokerQueue
- seeruntime/Session.run_flow
. This means that for distinguishing respondents that are being queued for the first time or not, we have to check forattempts > 1
closes #2306