Skip to content

Conversation

@jamesarich
Copy link
Collaborator

This commit introduces a SequentialJob class to ensure that only one service setup operation runs at a time. The new class cancels any previous job before launching a new one.

  • Added SequentialJob class to manage a single, cancellable coroutine Job.
  • Refactored MeshServiceClient to use the injected SequentialJob for handling service connection and disconnection, simplifying its logic.
  • Added unit tests for SequentialJob to verify that it cancels previous jobs and can be cancelled itself.
  • Updated dependencies to include kotlinx-coroutines-test for testing.

This commit introduces a `SequentialJob` class to ensure that only one service setup operation runs at a time. The new class cancels any previous job before launching a new one.

- Added `SequentialJob` class to manage a single, cancellable coroutine Job.
- Refactored `MeshServiceClient` to use the injected `SequentialJob` for handling service connection and disconnection, simplifying its logic.
- Added unit tests for `SequentialJob` to verify that it cancels previous jobs and can be cancelled itself.
- Updated dependencies to include `kotlinx-coroutines-test` for testing.

Signed-off-by: James Rich <[email protected]>
@github-actions github-actions bot added the refactor no functional changes label Dec 12, 2025
@codecov
Copy link

codecov bot commented Dec 12, 2025

Codecov Report

❌ Patch coverage is 58.33333% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 0.58%. Comparing base (f322660) to head (2ad058d).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
...main/java/com/geeksville/mesh/MeshServiceClient.kt 0.00% 5 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##            main   #3983      +/-   ##
========================================
+ Coverage   0.52%   0.58%   +0.06%     
========================================
  Files        395     396       +1     
  Lines      23172   23182      +10     
  Branches    2944    2943       -1     
========================================
+ Hits         122     136      +14     
+ Misses     23029   23025       -4     
  Partials      21      21              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jamesarich jamesarich added this pull request to the merge queue Dec 12, 2025
Merged via the queue into main with commit 4aea888 Dec 12, 2025
8 checks passed
@jamesarich jamesarich deleted the refactor/sequentialjob branch December 12, 2025 19:18
@jamesarich jamesarich added this to the 2.7.10 milestone Dec 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor no functional changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant