Skip to content

cleanup(workout): keep the teardown failure reason on restored recovery - #1330

Merged
9thLevelSoftware merged 1 commit into
mainfrom
cursor/restored-teardown-reason-1021
Oct 23, 2026
Merged

9thLevelSoftware merged 1 commit into
mainfrom
cursor/restored-teardown-reason-1021

Conversation

@9thLevelSoftware

Copy link
Copy Markdown
Owner

Restored teardown recovery now keeps the failure reason.

markRestoredRecoveryRequired stores the TeardownFailureReason and logs transition=recovery_required through the same helper as markRecoveryRequired. beginRestoredRecoveryAttempt logs that stored value as previousReason.

WorkoutExecutionGuardRestoredRuntimeTest checks that a rejected owner leaves the stored reason in place, and that the next restored attempt still logs it.

Verified with :shared:compileKotlinIosSimulatorArm64, :shared:compileAndroidHostTest, :androidApp:compileDebugKotlin, and :shared:testAndroidHostTest --tests '*WorkoutExecutionGuardRestoredRuntimeTest*' (-Pskip.supabase.check=true). The restored-runtime suite finished with 12 tests, 0 failures.

Open in Web Open in Cursor 

Restored recovery stores and logs the teardown failure reason with the live path, so the next restored attempt still records previousReason.

Co-authored-by: Devil <9thLevelSoftware@users.noreply.github.com>
@9thLevelSoftware
9thLevelSoftware marked this pull request as ready for review October 23, 2026 14:31
Copilot AI balanced review requested due to automatic review settings October 23, 2026 14:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@kilo-code-bot

kilo-code-bot Bot commented Oct 23, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: No Issues Found | Recommendation: Merge

Verdict: Approve — the restored teardown path now stores and logs the failure reason through the same helpers the live path uses, and the live path's emitted log strings are byte-identical to before.

Correctness / Safety Findings

No correctness or safety findings.

Details checked: markRestoredRecoveryRequired keeps its owner/ready/state gates, so a rejected owner still cannot mutate teardown state or overwrite the stored reason; the live markRecoveryRequired / beginRecoveryAttempt log payloads and the teardownFailureReason write order are unchanged; the shared teardownFailureReason field cannot be clobbered between a restored failure and its next restored attempt because the restored record blocks beginExecutionLocked, the live path is the only writer of teardownLease, and beginTeardownLocked/markTeardownReady null the field only on the live path.

Ponytail Review

Ponytail: Lean already. Ship.

The two new private helpers each have two call sites and remove the duplicated WORKOUT_TEARDOWN format strings instead of adding an abstraction layer; the restored path reuses the existing teardownFailureReason field rather than introducing a second stored reason concept.

Ponytail net: 0 lines.

Suggested Minimal Patch

No patch needed.

Final Merge Guidance

Can merge as-is.

Files Reviewed (2 files)
  • shared/src/commonMain/kotlin/com/devil/phoenixproject/presentation/manager/WorkoutExecutionGuard.kt
  • shared/src/commonTest/kotlin/com/devil/phoenixproject/presentation/manager/WorkoutExecutionGuardRestoredRuntimeTest.kt

Reviewed by minimax-m3 · Input: 74.6K · Output: 24.5K · Cached: 618.4K

Review guidance: REVIEW.md from base branch main

@9thLevelSoftware
9thLevelSoftware merged commit 5032a8f into main Oct 23, 2026
11 checks passed
@9thLevelSoftware
9thLevelSoftware deleted the cursor/restored-teardown-reason-1021 branch October 23, 2026 16:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants