fix: captured variables stay readable after re-enabling a pause point while paused
Merged
HA
3mo ago+68+68+01234567890123456789-16-16-01234567890123456789
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-pointagain on the same id (a natural move in a longcontrol-play-mode --action Stepsession, because the enable-time timeout does not extend after hits) silently cleared the raw capture holder.TryGetCapturedValuereturnedFound=falseand watch expressions built on it recordednullfrom 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
EnableandClear:Enablenow only resets the hit bookkeeping (ForgetHitSnapshotForId), whileClearkeeps 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 → stillFound=true→Step×5 → stillFound=true; resume still clears the holder. - No IPC wire-format change; protocol version intentionally untouched.