Cleanup Unbound Session & Tracker/Progress & Stale Types and Dependcies - #2628
Merged
Conversation
Unbound session will be cleaned up as it's not needed for the native application anymore
* Remove unbound session module with its related types from stypes as it's not used anymore. * Update references in .ai and docs
The progress module sent lifecycle transitions into a global channel on every operation start and stop, but no one was reading them, since `run_tracking()` is never called in the native app. So the messages kept piling up as long as the app runs.
* Remove `LifecycleTransition` and the progress types (`Progress`, `Ticks`, `Notification`). Their only consumer was the progress module in legacy session, which is already gone. * Remove the `Progress`, `SessionError` and `SessionDestroyed` callback events since core never emits them. * The callback match in the session service is exhaustive now, so its catch-all arm is gone too and new events will fail to compile until they are handled.
These endpoints and commands were driven by the Electron frontend and have no consumer in the native application: * Tracker and state debug modes with the operations statistics. Since `set_debug()` was never called, the debug flags stayed `false`, so the statistics were never collected and `get_operations_stat()` could only return an empty list. `serde_json` is no longer needed in the crate. * The `Sleep` operation with its handler and `ResultSleep`. * The error injection paths `trigger_state_error()` and `trigger_tracker_error()` with `ShutdownWithError` in both the tracker and the state loop. No test uses them, and re-adding such a hook is trivial once a test needs it. The operation name in `AddOperation` is dropped as well, since removing the statistics left it without any reader.
* Take `&Version` instead of a prefix string avoiding so an empty prefix edge-case * Replace `OperationTracker` with a local map of named `TrackedOperation` in the tracker loop * Extract `stale_before()` in cleanup to drop two duplicated modification-limit blocks * Replace the `_SECONDS: u64` cleanup constants with `Duration` constants * Update stale `.ai` context
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR provides large cleanup for multiple modules that aren't used anymore after migrating from electron based to native application.
It includes:
More details are in commit messages