remove maybeMarkActiveCommandFailed. this logic was moved in "updateActiveCommand"
This commit is contained in:
parent
a20cc1cca3
commit
e867b1397d
2 changed files with 6 additions and 13 deletions
|
@ -70,7 +70,6 @@ interface OmnipodDashPodStateManager {
|
|||
fun createActiveCommand(historyId: String): Single<ActiveCommand>
|
||||
fun updateActiveCommand(): Maybe<CommandConfirmed>
|
||||
fun observeNoActiveCommand(): Observable<PodEvent>
|
||||
fun maybeMarkActiveCommandFailed()
|
||||
|
||||
data class ActiveCommand(
|
||||
val sequence: Short,
|
||||
|
|
|
@ -228,16 +228,6 @@ class OmnipodDashPodStateManagerImpl @Inject constructor(
|
|||
}
|
||||
}
|
||||
|
||||
@Synchronized
|
||||
override fun maybeMarkActiveCommandFailed() {
|
||||
podState.activeCommand?.run {
|
||||
if (sentRealtime < createdRealtime) {
|
||||
// command was not sent
|
||||
podState.activeCommand = null
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Synchronized
|
||||
override fun updateActiveCommand() = Maybe.create<CommandConfirmed> { source ->
|
||||
podState.activeCommand?.run {
|
||||
|
@ -246,8 +236,12 @@ class OmnipodDashPodStateManagerImpl @Inject constructor(
|
|||
"lastResponse=$lastStatusResponseReceived " +
|
||||
"$sequenceNumberOfLastProgrammingCommand $historyId"
|
||||
)
|
||||
if (createdRealtime >= lastStatusResponseReceived)
|
||||
// we did not receive a valid response yet
|
||||
if (sentRealtime < createdRealtime) {
|
||||
// command was not sent, clear it up
|
||||
podState.activeCommand = null
|
||||
source.onComplete()
|
||||
} else if (createdRealtime >= lastStatusResponseReceived)
|
||||
// we did not receive a valid response yet
|
||||
source.onComplete()
|
||||
else {
|
||||
podState.activeCommand = null
|
||||
|
|
Loading…
Reference in a new issue