Skip to content
This repository was archived by the owner on May 6, 2022. It is now read-only.

Commit e98ea34

Browse files
committed
fix: waiting download authorization state
The service doesn't send again the authorization request message when a force ping is received. Fixed by adding a force auth request flag.
1 parent 8b60d57 commit e98ea34

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

core/src/main/kotlin/com/kynetics/updatefactory/ddiclient/core/actors/ConnectionManager.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ private constructor(scope: ActorScope) : AbstractActor(scope) {
109109
notificationManager.send(MessageListener.Message.Event.UpdateAvailable(res.deploymentActionId()))
110110
client.onDeploymentActionDetailsChange(res.deploymentActionId(), 0, state.deploymentEtag) { deplBaseResp, newDeploymentEtag ->
111111
etag = newDeploymentEtag
112-
this.send(Out.DeploymentInfo(deplBaseResp), state)
112+
this.send(Out.DeploymentInfo(deplBaseResp, state.deploymentEtag.isEmpty()), state)
113113
}
114114
actionFound = true
115115
}
@@ -244,7 +244,7 @@ private constructor(scope: ActorScope) : AbstractActor(scope) {
244244

245245
open class Out : Message() {
246246
object ConfigDataRequired : Out()
247-
data class DeploymentInfo(val info: DeplBaseResp) : Out()
247+
data class DeploymentInfo(val info: DeplBaseResp, val forceAuthRequest:Boolean = false) : Out()
248248
data class DeploymentCancelInfo(val info: CnclActResp) : Out()
249249

250250
object NoAction : Out()

core/src/main/kotlin/com/kynetics/updatefactory/ddiclient/core/actors/DeploymentManager.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ private constructor(scope: ActorScope) : AbstractActor(scope) {
5555

5656
when {
5757

58-
msg is DeploymentInfo && msg.downloadIs(Appl.forced) -> {
58+
msg is DeploymentInfo && msg.downloadIs(Appl.forced) -> {
5959
become(downloadingReceive(state.copy(deplBaseResp = msg.info)))
6060
child("downloadManager")!!.send(msg)
6161
}
@@ -80,7 +80,7 @@ private constructor(scope: ActorScope) : AbstractActor(scope) {
8080
private fun waitingDownloadAuthorization(state: State): Receive = { msg ->
8181
when {
8282

83-
msg is DeploymentInfo && msg.downloadIs(Appl.attempt) -> {}
83+
msg is DeploymentInfo && msg.downloadIs(Appl.attempt) && !msg.forceAuthRequest -> {}
8484

8585
msg is DeploymentInfo -> {
8686
become(beginningReceive(state))

0 commit comments

Comments
 (0)