@smbcloud / smbcloud-ascapi Mirror · read-only / commits / 5453376
Fork 0

Read-only mirror of github.com/smbcloudXYZ/smbcloud-ascapi.

Mirrored from https://github.com/smbcloudXYZ/smbcloud-ascapi.git

Synced Nov 25, 09:15 UTC

Check the fraction when reading back a halted rollout

A halt keeps the fraction the rollout reached, and a later resume is checked against it. The read-back only looked at status, so a halt that lost its fraction on Play's side would have reported success. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Co-Authored-By: siGit Code v1.7.6 <noreply@sigit.si>

Seto Elkahfi committed Nov 3, 2026 at 20:41 UTC 545337635349b1ef917072c470bda06e26e5cb87
1 file changed +15 -1
crates/frontend/src/play.rs
+15 -1
@@ -514,7 +514,21 @@ pub async fn rollout_track(
514 .iter()
515 .find(|r| r.version_codes.iter().any(|c| c == version_code))
516 .is_some_and(|r| match action {
517 - RolloutAction::Halt => r.status.as_deref() == Some("halted"),
517 + // A halt keeps the fraction the rollout reached, and a later resume
518 + // is checked against it, so a halt that dropped it did not land.
519 + RolloutAction::Halt => {
520 + let planned = plan
521 + .target
522 + .releases
523 + .iter()
524 + .find(|p| p.version_codes.iter().any(|c| c == version_code))
525 + .and_then(|p| p.user_fraction);
526 + r.status.as_deref() == Some("halted")
527 + && match (planned, r.user_fraction) {
528 + (Some(want), Some(got)) => (want - got).abs() < 1e-9,
529 + (want, got) => want.is_none() && got.is_none(),
530 + }
531 + }
532 RolloutAction::Complete => r.status.as_deref() == Some("completed"),
533 RolloutAction::Fraction(f) if f >= 1.0 => r.status.as_deref() == Some("completed"),
534 RolloutAction::Fraction(f) => {