Commit Graph

96 Commits

Author SHA1 Message Date
James Rich
140e062eee refactor: eliminate ProcessRadioResponseUseCase and packet-ID correlation
Replace the manual packet-ID tracking and meshPacketFlow subscription in
RadioConfigViewModel with direct typed returns from the SDK via
RadioConfigUseCase. The ViewModel now awaits typed results (User, Config,
ModuleConfig, channels, etc.) from suspend calls and maps AdminException
to UI error states.

Key changes:
- Delete ProcessRadioResponseUseCase (130 lines of manual proto decode)
- Remove requestIds state, registerRequestId, processPacketResponse,
  sendAdminRequest, and meshPacketFlow subscription from ViewModel
- Rewrite setResponseStateLoading to use direct coroutine calls
- Admin actions (reboot/shutdown/etc.) fire directly without session key
  preflight (SDK handles retryOnSessionExpiry transparently)
- All setters (setConfig, setModuleConfig, setOwner, updateChannels)
  no longer return/track packetIds
- Remove messageSender dependency from NodeManagementActions
- Update InstallProfileUseCase to use editSettings {} receiver pattern
- Update all callers: CleanNodeDatabaseUseCase, Esp32OtaUpdateHandler,
  NodeManagementActions
- Rewrite RadioConfigViewModelTest for new direct-await semantics
- Update RadioConfigUseCaseTest and InstallProfileUseCaseTest

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-06 17:52:05 -05:00
James Rich
c712d7ef68 chore: remove dead SfppHasher + unused NodeRepository injection
- Delete SfppHasher wrapper (SDK SfppHash handles SFPP hashing)
- Remove unused NodeRepository from StoreForwardPacketHandlerImpl
- Update tests to match constructor change

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-06 17:52:05 -05:00
James Rich
7683db0c57 feat: deep SDK integration — retry delivery, Store-and-Forward API, congestion surfacing
I1 — RetryPolicy in MessageDeliveryTracker:
- track() now accepts optional RetryPolicy (default: ExponentialBackoff 3 attempts)
- Failed sends automatically retry before marking ERROR
- UI sees ENROUTE during retry attempts

I2 — Store-and-Forward SDK consumption:
- SdkStateBridge observes storeForward.events and servers
- ServiceRepository exposes storeForwardServers StateFlow
- SdkRadioController.requestStoreForwardHistory() delegates to SDK
- HistoryManagerImpl uses SDK path instead of manual packet construction

I3 — Congestion level surfacing:
- SdkStateBridge handles MeshEvent.CongestionWarning
- ServiceRepository.congestionLevel StateFlow exposed to UI
- Cleared on disconnect

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-06 17:52:05 -05:00
James Rich
27b2c19e69 refactor: narrow ViewModel injections, add ConnectionAware, delete dead code, integration tests
ViewModel Narrowing:
- V1: Created ConnectionAware interface; MessageSender, DeviceAdmin, DeviceControl extend it
- V2: Narrowed 6 ViewModels/actions to focused sub-interfaces (DeviceAdmin, MessageSender, DataRequester, DeviceControl)

Cleanup:
- C1: Deleted dead MeshDataMapper and its DI registration

Integration Tests:
- T2: SdkStateBridgeTest verifying WentOffline/CameOnline presence handling
- Verified Koin resolution, full test suite passes

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-06 17:52:05 -05:00
James Rich
e9cb439849 feat: rearchitect around SDK — decompose RadioController, simplify DataPacket, integrate SDK utilities
Android rearchitecture consuming meshtastic-sdk improvements:

A1 — ConnectionState Enrichment:
- Rich sealed interface with Connecting(attempt), Configuring(phase, progress), Reconnecting(attempt)
- SdkStateBridge maps SDK states preserving metadata

A2 — MessageHandle Integration:
- MessageDeliveryTracker: tracks delivery via SDK MessageHandle
- SdkRadioController captures handles on send

A3 — RadioController Decomposition:
- Split into 5 focused interfaces: MessageSender, DeviceAdmin, RemoteAdmin, DeviceControl, DataRequester
- RadioController extends all; SdkRadioController binds all via Koin

A4 — DataPacket Simplification:
- to/from fields changed from String? to Int (node numbers directly)
- Removed string ID parsing layer; added BROADCAST/LOCAL constants
- Updated ~40 consumer files across feature modules

A5 — SDK Utility Consumption:
- DeviceVersion, Capabilities, SfppHasher, LocationUtils delegate to SDK
- Removed duplicated protocol logic

A6 — Presence Events:
- SdkStateBridge handles NodeChange.WentOffline/CameOnline
- Updates node online status via repository

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-06 17:52:05 -05:00
James Rich
43ecd2eb73 chore: rename stale files and update migration doc
- NodeInfo.kt → MeshModels.kt (no longer contains NodeInfo class)
- NodeManagerImplTest.kt → SdkNodeRepositoryImplTest.kt (tests SdkNodeRepositoryImpl)
- Update MIGRATION-REMAINING.md with dead code removal, error handling,
  and NodeManager merge status

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-06 17:52:05 -05:00
James Rich
e7d1767527 chore: remove ~220 LOC dead code from node layer
Delete dead methods from NodeManager/NodeRepository interfaces:
- allowNodeDbWrites, setAllowNodeDbWrites (never read)
- loadCachedNodeDB (no-op, zero-value call in orchestrator)
- getNodes(): List<NodeInfo> (deprecated, unused)
- handleReceivedPaxcounter (zero callers)
- handleReceivedNodeStatus, updateNodeStatus (zero callers)
- insertMetadata (zero production callers)

Delete NodeInfo data class (85 LOC):
- All consumers now use Node domain model directly
- Retained MeshUser, Position, DeviceMetrics, EnvironmentMetrics
  which have active consumers across feature modules

Remove corresponding implementations from SdkNodeRepositoryImpl,
FakeNodeRepository, and test verifications.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-06 17:52:05 -05:00
James Rich
82926fd734 feat: event firmware easter egg with ambient branding (#5354)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-05-04 19:37:47 +00:00
James Rich
2822290908 refactor(build): build-logic cleanup, CC safety, and detekt 2.0 upgrade (#5311) 2026-05-01 02:48:37 +00:00
James Rich
228d872f9d feat(connections): unified device list, ACCESS_LOCAL_NETWORK, transport filter chips (#5219)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-22 19:34:22 +00:00
James Rich
f14ae2643c feat(node): smoother remote-admin UX with per-node session tracking (#5217)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-22 14:21:04 -05:00
renovate[bot]
b1d87e3333 chore(deps): update core/proto/src/main/proto digest to 97ea65a (#5212)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: James Rich <james.a.rich@gmail.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-22 10:32:07 -05:00
James Rich
14e86b90f1 feat(mqtt): adopt mqttastic-client-kmp 0.2.0 — disconnect reasons + Test Connection (#5181)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-17 21:33:55 -05:00
James Rich
cdeb1ac532 fix: redact MeshLog proto secrets and centralize Compose keep-rules (#5166)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-17 16:20:50 +00:00
James Rich
a97f704300 feat(mqtt): migrate to MQTTastic-Client-KMP (#5165)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-17 15:19:08 +00:00
James Rich
72b981f73b chore: KMP audit — commonize code, centralize utilities, eliminate dead abstractions (#5133)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-04-15 02:17:50 +00:00
James Rich
e85300531e refactor(transport): complete transport architecture overhaul — extract callback, wire BleReconnectPolicy, fix safety issues (#5080) 2026-04-12 04:22:18 +00:00
James Rich
9468bc6ebe refactor(service): unify dual connectionState flows into single source of truth (#5077) 2026-04-12 00:50:52 +00:00
James Rich
62264b10c6 refactor(model): remove ConnectionState helper methods and fix updateStatusNotification return type (#5074) 2026-04-11 23:41:34 +00:00
James Rich
40ea45a4fe fix(settings): hide Status Message config until firmware v2.8.0 (#5070) 2026-04-11 22:06:53 +00:00
James Rich
520fa717a9 refactor(metrics/map): DRY up charts, decompose MapView monoliths, add test coverage (#5049) 2026-04-10 20:54:09 +00:00
James Rich
9c0e9b82d6 feat(charts): adopt Vico best practices, add sensor data, and migrate TracerouteLog (#5026) 2026-04-09 23:44:59 +00:00
James Rich
b3be9e2c38 fix: improve PKI message routing and resolve database migration racecondition (#4996) 2026-04-05 00:37:20 +00:00
James Rich
6af3ad6f0c refactor(service): harden KMP service layer — database init, connection reliability, handler decomposition (#4992) 2026-04-04 18:07:44 +00:00
James Rich
664ebf218e refactor: null safety, update date/time libraries, and migrate tests (#4900)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
2026-03-23 23:17:50 +00:00
James Rich
c38bfc64de Refactor command handling, enhance tests, and improve discovery logic (#4878)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
2026-03-22 05:42:27 +00:00
James Rich
d136b162a4 feat: Implement iOS support and unify Compose Multiplatform infrastructure (#4876) 2026-03-21 23:19:13 +00:00
James Rich
1e55e554be feat: Add KMP URI handling, import, and QR code generation support (#4856) 2026-03-19 13:36:19 -05:00
James Rich
dcbbc0823b feat: Integrate Mokkery and Turbine into KMP testing framework (#4845) 2026-03-18 18:33:37 -05:00
James Rich
d314ee2d8a feat: mqtt (#4841) 2026-03-18 18:39:20 +00:00
James Rich
807db83f53 feat: service extraction (#4828) 2026-03-17 14:06:01 -05:00
James Rich
ac6bb5479b feat: introduce Desktop target and expand Kotlin Multiplatform (KMP) architecture (#4761)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
2026-03-12 21:14:49 +00:00
James Rich
2c49db8041 feat/decoupling (#4685)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
2026-03-03 13:15:28 +00:00
James Rich
8c6bd8ab7a feat: settings rework part 2, domain and usecase abstraction, tests (#4680)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
2026-03-02 18:15:33 +00:00
James Rich
b2b21e10e2 feat: upcoming support for tak and trafficmanagement configs, device hw (#4671)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
2026-02-27 17:44:19 +00:00
James Rich
d408964f07 refactor: KMP Migration, Messaging Modularization, and Handshake Robustness (#4631)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
2026-02-24 12:37:33 +00:00
James Rich
6bfa5b5f70 refactor(ble): Centralize BLE logic into a core module (#4550)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
2026-02-20 12:41:52 +00:00
James Rich
c690ddc7ea feat: Accurately display outgoing diagnostic packets (#4569)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
2026-02-16 22:09:21 +00:00
James Rich
0f03492ac6 fix: uri handling, ci test setup (#4556)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
2026-02-14 16:07:03 +00:00
James Rich
5ca2ab4695 refactor(time): Centralize time handling with kotlinx-datetime (#4545)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
2026-02-14 02:01:07 +00:00
James Rich
80d9a2e0aa fix(release): fixes to prep for release (#4546)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
2026-02-12 20:23:19 +00:00
James Rich
bd8ff75787 feat: Remove auto-retry confirmation for messages (#4513)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
2026-02-10 14:00:41 +00:00
James Rich
ea6d1ffa32 feat: consolidate dialogs (#4506)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
2026-02-08 22:45:52 +00:00
James Rich
96551761c8 feat(sharing): Refactor QR/NFC scanning with ML Kit and CameraX (#4471)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
2026-02-06 04:16:16 +00:00
James Rich
f1520eb383 feat(example): Add packet log and UI improvements (#4455)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
2026-02-05 07:24:15 -06:00
James Rich
25657e8f8f feat(wire): migrate from protobuf -> wire (#4401)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
2026-02-04 00:01:12 +00:00
James Rich
9dbc8b7fbf refactor(model): Make DataPacket fully mutable and fix Parcel reading (#4431)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
2026-02-03 21:14:24 +00:00
James Rich
37b2efa176 feat(settings): Add firmware capability checks for settings (#4403)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
2026-02-02 15:35:20 +00:00
James Rich
15760da074 Refactor: Create core:api module and set up publishing (#4362) 2026-01-29 13:45:00 -06:00
James Rich
70a1b3c479 Refactor: Replace custom charts with Vico library (#4348)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
2026-01-29 00:52:59 +00:00