@@ -125,33 +125,30 @@ async def deployment_feedback(
125
125
await updater .deployment_action_success ()
126
126
await updater .update_device_state (UpdateStateEnum .FINISHED )
127
127
128
- # not guaranteed to be the correct rollout - see next comment.
129
128
rollout = await updater .get_rollout ()
130
129
if rollout :
131
130
if rollout .software == reported_software :
132
131
rollout .success_count += 1
133
132
await rollout .save ()
134
133
else :
134
+ # edge case where device update mode got changed while update was running
135
135
logging .warning (
136
136
f"Updating rollout success stats failed, software={ reported_software .id } , device={ updater .dev_id } " # noqa: E501
137
137
)
138
138
139
- # setting the currently installed version based on the current assigned software / existing rollouts
140
- # is problematic. Better to assign custom action_id for each update (rollout id? software id? new id?).
141
- # Alternatively - but requires customization on the gateway side - use version reported by the gateway.
142
139
await updater .update_sw_version (reported_software .version )
143
140
logger .debug (f"Installation successful, software={ reported_software .version } , device={ updater .dev_id } " )
144
141
145
142
elif data .status .result .finished == FeedbackStatusResultFinished .FAILURE :
146
143
await updater .update_device_state (UpdateStateEnum .ERROR )
147
144
148
- # not guaranteed to be the correct rollout - see comment above.
149
145
rollout = await updater .get_rollout ()
150
146
if rollout :
151
147
if rollout .software == reported_software :
152
148
rollout .failure_count += 1
153
149
await rollout .save ()
154
150
else :
151
+ # edge case where device update mode got changed while update was running
155
152
logging .warning (
156
153
f"Updating rollout failure stats failed, software={ reported_software .id } , device={ updater .dev_id } " # noqa: E501
157
154
)
0 commit comments