Skip to content

feat(tak): show local server status - #6599

Open
RCGV1 wants to merge 2 commits into
meshtastic:mainfrom
RCGV1:codex/feat/tak-server-status
Open

feat(tak): show local server status#6599
RCGV1 wants to merge 2 commits into
meshtastic:mainfrom
RCGV1:codex/feat/tak-server-status

Conversation

@RCGV1

@RCGV1 RCGV1 commented Aug 9, 2026

Copy link
Copy Markdown
Member

Summary

  • Show local TAK server state directly in Android settings: off, starting, listening, connected, unavailable, not running, and failed.
  • Use ATAK-only wording throughout the Android local TAK Server screen.
  • Make server startup and shutdown resilient to failed or delayed binds.

Screenshots

Listening for ATAK:

Listening for ATAK

Startup failure with retry guidance:

TAK server start failure

Verification

  • Targeted TAK server, service, and settings unit tests
  • Detekt and Spotless checks for changed modules
  • iOS simulator compilation for shared code
  • Full screenshot reference update and validation

Summary by CodeRabbit

  • New Features

    • Added detailed TAK server status indicators, including starting, connected, waiting, failed, unavailable, and disabled states.
    • Displayed the number of connected clients in the TAK server settings.
    • Added localized descriptions and status labels.
  • Bug Fixes

    • Improved TAK server startup retry and shutdown behavior.
    • Prevented stale or duplicate server starts and ensured failed starts report an error.
    • Clarified TAK availability on unsupported platforms.

@coderabbitai

coderabbitai Bot commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: c3268853-c2d5-4cbc-a98d-2971819052ce

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

TAK server lifecycle state now includes support, startup, and startup-error reporting. Service shutdown and retry behavior handles pending and failed starts. Settings display localized status text, client counts, status indicators, previews, and screenshot coverage.

Changes

TAK server lifecycle and settings status

Layer / File(s) Summary
TAK server lifecycle state
core/takserver/src/commonMain/..., core/takserver/src/iosMain/..., core/takserver/src/commonTest/...
TAKServerManager exposes support, startup, and error state. It prevents duplicate starts, invalidates stale completions, and clears state during stop. Tests cover failed and pending starts.
TAK service stop and retry handling
core/service/src/commonMain/..., core/service/src/commonTest/...
The orchestrator stops TAK integration when disabled and during shutdown. Tests cover retry after failure and stopping during startup.
Settings status presentation and validation
core/resources/..., feature/settings/..., screenshot-tests/...
The settings UI resolves TAK server state into localized status rows with client counts and indicators. Previews, unit tests, and light/dark screenshots cover the status variants.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

Suggested labels: enhancement

Suggested reviewers: jamesarich, thebentern

🚥 Pre-merge checks | ✅ 5 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Tests Prove The Path, Not The End State ⚠️ Warning The retry test verifies two starts but only verifies that stop occurred somewhere; final cleanup can satisfy it, so it does not prove disable-triggered stop before the retry. Record or verify the lifecycle in order, and assert the sequence is start, stop on disable, then start; do not let final orchestrator cleanup satisfy the stop assertion.
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: displaying local TAK server status.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Sibling Call Sites And Presence Semantics ✅ Passed The diff changes TAK lifecycle/status booleans and client counts only; it changes no nullable measurement field or RSSI/temperature/current/voltage/particulate default.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added the enhancement New feature or request label Aug 9, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@core/service/src/commonTest/kotlin/org/meshtastic/core/service/MeshServiceOrchestratorTest.kt`:
- Around line 206-220: Update testTakServerCanRetryAfterFailedStart and the
related second lifecycle test to make the manager’s first start invocation fail,
then verify the subsequent retry succeeds and the expected start/stop calls
occur. Explicitly verify takServerManager.start and takServerManager.stop for
the second orchestrator start/stop cycle so both lifecycle paths prove their
side effects.

In
`@core/takserver/src/commonMain/kotlin/org/meshtastic/core/takserver/TAKServerManager.kt`:
- Around line 104-111: Serialize TAKServerManager lifecycle attempts so start
admission cannot overlap an invalidated startup: update TAKServerManager.kt
lines 104-111 to coordinate start and stop, and lines 132-158 to use a
per-attempt server handle or await prior startup cleanup before retrying,
ensuring stale completion cannot stop a newer listener. In
TAKServerManagerTest.kt lines 223-233, first drive start A into its pending
state through the production lifecycle path, then stop, start B, complete A, and
verify B remains active.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: f8845805-20ce-40c1-a11d-4f367bdb20c5

📥 Commits

Reviewing files that changed from the base of the PR and between a885127 and 21d2039.

⛔ Files ignored due to path filters (8)
  • screenshot-tests/src/screenshotTestDebug/reference/org/meshtastic/screenshots/feature/SettingsScreenshotTestsKt/ScreenshotTakServerSectionConnected_Dark_d19fbf1f_0.png is excluded by !**/*.png, !**/*.png
  • screenshot-tests/src/screenshotTestDebug/reference/org/meshtastic/screenshots/feature/SettingsScreenshotTestsKt/ScreenshotTakServerSectionConnected_Light_b29dc7a7_0.png is excluded by !**/*.png, !**/*.png
  • screenshot-tests/src/screenshotTestDebug/reference/org/meshtastic/screenshots/feature/SettingsScreenshotTestsKt/ScreenshotTakServerSectionDisabled_Dark_d19fbf1f_0.png is excluded by !**/*.png, !**/*.png
  • screenshot-tests/src/screenshotTestDebug/reference/org/meshtastic/screenshots/feature/SettingsScreenshotTestsKt/ScreenshotTakServerSectionDisabled_Light_b29dc7a7_0.png is excluded by !**/*.png, !**/*.png
  • screenshot-tests/src/screenshotTestDebug/reference/org/meshtastic/screenshots/feature/SettingsScreenshotTestsKt/ScreenshotTakServerSectionEnabled_Dark_d19fbf1f_0.png is excluded by !**/*.png, !**/*.png
  • screenshot-tests/src/screenshotTestDebug/reference/org/meshtastic/screenshots/feature/SettingsScreenshotTestsKt/ScreenshotTakServerSectionEnabled_Light_b29dc7a7_0.png is excluded by !**/*.png, !**/*.png
  • screenshot-tests/src/screenshotTestDebug/reference/org/meshtastic/screenshots/feature/SettingsScreenshotTestsKt/ScreenshotTakServerSectionFailed_Dark_d19fbf1f_0.png is excluded by !**/*.png, !**/*.png
  • screenshot-tests/src/screenshotTestDebug/reference/org/meshtastic/screenshots/feature/SettingsScreenshotTestsKt/ScreenshotTakServerSectionFailed_Light_b29dc7a7_0.png is excluded by !**/*.png, !**/*.png
📒 Files selected for processing (13)
  • .skills/compose-ui/strings-index.txt
  • core/resources/src/commonMain/composeResources/values/strings.xml
  • core/service/src/commonMain/kotlin/org/meshtastic/core/service/MeshServiceOrchestrator.kt
  • core/service/src/commonTest/kotlin/org/meshtastic/core/service/MeshServiceOrchestratorTest.kt
  • core/takserver/src/commonMain/kotlin/org/meshtastic/core/takserver/TAKServer.kt
  • core/takserver/src/commonMain/kotlin/org/meshtastic/core/takserver/TAKServerManager.kt
  • core/takserver/src/commonTest/kotlin/org/meshtastic/core/takserver/FakeTAKServerManager.kt
  • core/takserver/src/commonTest/kotlin/org/meshtastic/core/takserver/TAKServerManagerTest.kt
  • core/takserver/src/iosMain/kotlin/org/meshtastic/core/takserver/TAKServerIos.kt
  • feature/settings/src/commonMain/kotlin/org/meshtastic/feature/settings/radio/component/TAKConfigItemList.kt
  • feature/settings/src/commonMain/kotlin/org/meshtastic/feature/settings/radio/component/TAKConfigPreviews.kt
  • feature/settings/src/commonTest/kotlin/org/meshtastic/feature/settings/radio/component/TakServerStatusTest.kt
  • screenshot-tests/src/screenshotTest/kotlin/org/meshtastic/screenshots/feature/SettingsScreenshotTests.kt

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

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant