fix: captured variables stay readable after re-enabling a pause point while paused

Merged
HA
3mo ago
+68-16

Summary

  • Re-enabling a pause point while Unity stays paused (for example to refresh its timeout during a Step session) no longer breaks UloopPausePoint.TryGetCapturedValue; the captured variables of the current hit stay readable.
  • Docs: clarified that watch expressions evaluate only while Play Mode is running AND the Editor is paused, so the wording can no longer be read as "also evaluates while the game runs unpaused."

User Impact

  • Before: after a hit, running enable-pause-point again on the same id (a natural move in a long control-play-mode --action Step session, because the enable-time timeout does not extend after hits) silently cleared the raw capture holder. TryGetCapturedValue returned Found=false and watch expressions built on it recorded null from that point on. This was reported from real usage as a suspected Step bug.
  • After: the held captures survive a same-id re-enable, matching the documented lifetime (the holder clears on resume, explicit clear, a replacing hit, or PlayMode exit — a re-enable does not resume Unity, so the paused-window invariant still holds).

Changes

  • Split the registry helper shared by Enable and Clear: Enable now only resets the hit bookkeeping (ForgetHitSnapshotForId), while Clear keeps dropping the raw capture holder (ClearHitSnapshotAndRawCaptureForId). ClearAll, the simulate-* snapshot reset, and the resume/PlayMode-exit lifecycle are unchanged.
  • Added a regression test: hit with a captured frame, re-enable the same id, assert the captured value is still retrievable.
  • Pause-point skill doc (source + two generated copies, byte-identical): documented the re-enable behavior and reworded the watch-expression evaluation timing (docs-only second commit).

Verification

  • TDD: the new test failed (found=false) before the fix and passes after.
  • uloop compile: 0 errors / 0 warnings.
  • EditMode PausePointTests: 48/48 green, including existing clear/replace/resume regressions.
  • E2E on a live Unity 6000.3.15f1 project: hit → Found=true → same-id re-enable → still Found=true → Step ×5 → still Found=true; resume still clears the holder.
  • No IPC wire-format change; protocol version intentionally untouched.