fix(train): only the firmware version the person agreed to is written (ADR 0030, D55)
Relayed by the instance, the version asked again before downloading was written even where it wasn't the one shown and agreed to, and the band recorded as at the agreed one. Another version now writes nothing and is offered instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Tizian 「ティツィアーン」 <raisondetredev@pm.me>
This commit is contained in:
parent
c8f16686ec
commit
ac6cff179f
1 changed files with 28 additions and 0 deletions
|
|
@ -297,6 +297,14 @@ class PolarLoop(
|
|||
_update(_with(_status.loop!.copyWith(firmwareOffered: () => null)));
|
||||
throw const LoopFailed('no update');
|
||||
}
|
||||
// Only the version the person agreed to is written: another one
|
||||
// offered since is offered to them instead.
|
||||
if (offered != version) {
|
||||
_update(
|
||||
_with(_status.loop!.copyWith(firmwareOffered: () => offered)),
|
||||
);
|
||||
throw const LoopFailed('another update');
|
||||
}
|
||||
final bytes = await _relayed(
|
||||
() =>
|
||||
relay.download(hardwareCode: info.hardwareCode, version: offered),
|
||||
|
|
|
|||
Loading…
Reference in a new issue