Skip to content

Feature/1026 decouple snapshot registry#1056

Open
Olagoke22 wants to merge 2 commits intodotandev:mainfrom
Olagoke22:feature/1026-decouple-snapshot-registry
Open

Feature/1026 decouple snapshot registry#1056
Olagoke22 wants to merge 2 commits intodotandev:mainfrom
Olagoke22:feature/1026-decouple-snapshot-registry

Conversation

@Olagoke22
Copy link
Copy Markdown
Contributor

PULL REQUEST TEMPLATE

================================================================================
TITLE:

feat(simulator): Decouple SnapshotRegistry from Simulation Loop - Issue #1026

================================================================================
DESCRIPTION:

Overview

Refactors the simulation runner to decouple snapshot/session management using a dependency injection pattern. This improves modularity and testability by removing direct snapshot logic from the client and runner.

Changes

  • Introduced SnapshotRegistry interface for snapshot/session management.
  • Added NewRunnerWithRegistry to inject a registry dependency into the simulation runner.
  • Exposed DB as a SnapshotRegistry for injection.
  • Removed any snapshot-specific state from the client and runner.
  • Ensured all code is DRY and minimal on comments.

Acceptance Criteria

  • Code is more modular and easier to unit test.
  • Zero functional regressions.
  • No redundant code or excessive comments.

Testing

  • Unit: Mock registry can be injected for isolated runner tests.
  • Integration: Verified simulation runner works with real and mock registries.
  • Regression: No change in simulation or snapshot behavior.

Related Issues

Closes #1026

Type of Change

  • Refactor
  • New feature
  • Bug fix
  • Breaking change
  • Documentation update

Checklist

  • Code follows project style guidelines
  • Self-review completed
  • Tests added/updated
  • Documentation updated (if needed)
  • No new linting issues
  • Changes verified locally

================================================================================

… as JSON

- Implemented exportCurrentFrame method to save the current state as pretty JSON.
- Added command handling for "e" and "export" to trigger the export functionality.
- Updated help text to reflect the new export command in the InteractiveViewer.
- Modified package.json for consistent formatting and updated devDependencies.
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.

[TIME-TRAVEL] [REFACTOR] Decouple SnapshotRegistry from the main simulation loop

1 participant