Skip to content

Cleanup Unbound Session & Tracker/Progress & Stale Types and Dependcies - #2628

Merged
AmmarAbouZor merged 8 commits into
esrlabs:masterfrom
AmmarAbouZor:cleanup-unbound
Aug 14, 2026
Merged

Cleanup Unbound Session & Tracker/Progress & Stale Types and Dependcies #2628
AmmarAbouZor merged 8 commits into
esrlabs:masterfrom
AmmarAbouZor:cleanup-unbound

Conversation

@AmmarAbouZor

Copy link
Copy Markdown
Member

This PR provides large cleanup for multiple modules that aren't used anymore after migrating from electron based to native application.

It includes:

  • Move used functions out of unbound session module and remove it with its types from stypes crate
  • Remove not used tracker/progress operation which was originally used for debugging purposes in Chipmunk 3
  • Replace lazy_static with std LazyCell.
  • Cleanup dependecies & types + Refactoring

More details are in commit messages

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
@AmmarAbouZor
AmmarAbouZor merged commit ea00f8c into esrlabs:master Aug 14, 2026
1 check passed
@AmmarAbouZor
AmmarAbouZor deleted the cleanup-unbound branch August 14, 2026 14:49
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.

1 participant