Skip to content

fix(backend): reset pause state before replaying rollback survivors (#1703) - #1717

Merged
blurbeast merged 2 commits into
LabsCrypt:mainfrom
intelliDean:fix/1703-reset-pause-state-rollback
Oct 22, 2026
Merged

blurbeast merged 2 commits into
LabsCrypt:mainfrom
intelliDean:fix/1703-reset-pause-state-rollback

Conversation

@intelliDean

Copy link
Copy Markdown
Contributor

Closes #1703

Summary

  • Initializes reconstructible pause state (isPaused = false, pausedAt = null, totalPausedDuration = 0) from a canonical baseline rather than the reverted row before replaying surviving events.
  • Ensures encountering a CREATED event resets pause fields.
  • Safely parses metadata for PAUSED and RESUMED events during replay.

Testing

  • Added 3 test cases in backend/tests/reorg-resilience.test.ts verifying rollback of PAUSED, RESUMED, and repeated pause cycles.
  • Verified all 17 reorg resilience tests pass.

…absCrypt#1703)

- Initialize reconstructible pause fields (isPaused=false, pausedAt=null, totalPausedDuration=0) from canonical baseline before replaying surviving events
- Explicitly reset pause fields in CREATED event handler during replay
- Ensure RESUMED event metadata parsing handles numeric/string totalPausedDuration and updates totalPausedDuration incrementally when missing
- Add comprehensive regression tests for rollback of PAUSED, RESUMED, and repeated pause cycles
@blurbeast
blurbeast merged commit c082e3c into LabsCrypt:main Oct 22, 2026
14 checks passed
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.

[fix] Reset pause state before replaying rollback survivors

2 participants