Skip to content

feat: Add Development Tools section to Event Store#2791

Open
woksin wants to merge 21 commits into
mainfrom
feat/reset-data
Open

feat: Add Development Tools section to Event Store#2791
woksin wants to merge 21 commits into
mainfrom
feat/reset-data

Conversation

@woksin
Copy link
Copy Markdown
Contributor

@woksin woksin commented Mar 11, 2026

Summary

Adds development-only reset tooling for Chronicle, including backend endpoints, reset-aware connection handling, system re-initialization, integration coverage, and a Workbench UI for triggering resets in development builds.

Added

  • Development-only endpoints for resetting all Chronicle state or a single event store
  • A Development Tools page in Workbench under System for development builds
  • A reusable Chronicle initializer for re-bootstrapping the system after reset
  • Integration tests and specs covering reset behavior, reconnect behavior, and initialization behavior

Changed

  • Development builds now compile and package dedicated server and Workbench outputs with development tools enabled
  • Connection handling now supports coordinated client disconnection, connection blocking during reset, and reconnect behavior after stream completion or failure
  • Server startup initialization now uses a reusable initializer shared with development reset flows
  • Read model watchers and related client-side infrastructure now recover more cleanly across disconnect/reconnect cycles

Fixed

  • Resetting Chronicle now clears event store registry state in addition to dropping databases, preventing stale registrations after grain eviction
  • Reset operations now disconnect active clients before wiping state, avoiding clients continuing against invalid server state
  • Resetting a single event store now leaves other event stores intact
  • Webhook subscription setup now happens immediately on add/update instead of relying on reminder scheduling

woksin added 4 commits March 11, 2026 02:16
- Introduced a new Development Tools component for managing event store states.
- Added functionality to reset all states and individual event stores.
- Updated routing to include Development Tools in the Event Store menu.
- Enhanced localization with new strings for Development Tools.
- Marked several API classes to treat warnings as errors for better validation.
@woksin
Copy link
Copy Markdown
Contributor Author

woksin commented Mar 11, 2026

@copilot fix all ci issues

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 11, 2026

@woksin I've opened a new pull request, #2797, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI and others added 9 commits March 11, 2026 11:10
…mentTools and integration tests

Co-authored-by: woksin <13407188+woksin@users.noreply.github.com>
…ation test

Co-authored-by: woksin <13407188+woksin@users.noreply.github.com>
…Docker with DEVELOPMENT, fix test pollution

Co-authored-by: woksin <13407188+woksin@users.noreply.github.com>
Co-authored-by: woksin <13407188+woksin@users.noreply.github.com>
…ker image build

Co-authored-by: woksin <13407188+woksin@users.noreply.github.com>
Co-authored-by: woksin <13407188+woksin@users.noreply.github.com>
…em event store, remove unused using

Co-authored-by: woksin <13407188+woksin@users.noreply.github.com>
…reserve auth state

Co-authored-by: woksin <13407188+woksin@users.noreply.github.com>
…ertions into single fact

Co-authored-by: woksin <13407188+woksin@users.noreply.github.com>
@einari
Copy link
Copy Markdown
Contributor

einari commented Mar 12, 2026

@woksin Great, I love the idea of being able to just «reset». On a reset, we should rerun any seed data.
The beauty of that is that you can actually be using a developer loop using dotnet watch run and just reset in the middle. The client doesn’t really need to be restarted then.

A second note; we have at the top of the React hierarchy the <WorkbenchContext/> - instead of doing the IsAvailable type we could have a property called isDevelopment it be hooked up to the backend for getting if we’re in development or not. Technically, we could even do it so that it doesn’t do a query to the backend - which would be the ideal. As we do with the backend for the DEVELOPMENT preprocessor we could use env and just have it be there at build time, making the feature only available in the DEVELOPMENT image.

You could even toggle it specifically in the EventStore.tsx file down to the level of not even importing it - making it not part of the bundle even.

@copilot

woksin and others added 6 commits March 12, 2026 10:25
…oolean, remove IActionResult, and adjust event store reset logic
Fix CI: restore generated proxies, fix specs, and fix integration test failures
- Added `ClientConnectionManager` to manage client connections, including registration, unregistration, and disconnection of all clients.
- Introduced logging for connection management actions.
- Created unit tests for connection management functionalities, including connection registration, unregistration, and disconnection scenarios.
- Developed `ConnectionService` to handle client connection requests and keep-alive pings, ensuring proper interaction with the `ClientConnectionManager`.
- Implemented development tools for resetting all state and event stores, with appropriate blocking of connections during these operations.
- Removed obsolete API files related to development tools.
- Updated the front-end to conditionally render development tools based on the environment.
@woksin woksin added the minor label Mar 12, 2026
@woksin
Copy link
Copy Markdown
Contributor Author

woksin commented Mar 13, 2026

@einari wanna have a second look here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants