mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-09-15 23:00:09 -04:00
core:data ties together core:database, core:datastore, core:di, core:model, core:network, core:prefs, core:repository (all already wasmJs-enabled), core:takserver (out of scope, relocated below), and Room -- the last of which turned out to be the real blocker. core:takserver's dependency moves to nonWebMain-only: a grep pass confirmed core:data's own commonMain never actually references org.meshtastic.tak (the only "TAK" substring matches were the unrelated PortNum.ATAK_PLUGIN protobuf constant and a code comment), so this is a mechanical relocation, not a port -- core:takserver itself stays out of scope (niche ATAK feature). MqttManagerImpl.kt duplicated the exact TCP+WS transport composition core:network's MqttTransportSelection.kt already solved for MQTTRepositoryImpl. Rather than duplicate the platform-selection logic (and its TCP-exclusion reasoning) a second time, core:network's mqttTransportFactory drops its `internal` modifier and becomes public; MqttManagerImpl.kt's one-off probe client now calls it directly. The real, unpredicted blocker: core:database exposes Room only as `implementation` in its own commonMain, so RoomDatabase -- the supertype of MeshtasticDatabase that core:data's repositories reach through DatabaseProvider -- isn't visible to external consumers on wasmJs. This never surfaced on android/jvm/iOS because core:data's own jvmAndroidMain already carries the identical redundant Room redeclaration, for the same reason, pre-dating this session. Fixed with a matching wasmJsMain dependency on androidx.room.runtime/androidx.room.paging (both confirmed to publish real wasmJs variants; sqlite-bundled stays excluded, native-only and unrelated to RoomDatabase itself). core:database's own implementation-vs-api Room exposure would be a cleaner long-term fix but is out of this pass's scope since nothing else currently needs it. 14 of core:data's 33 commonTest files -- the ones that actually import core:testing (core:testing itself has no wasmJs target, same gap core:ble/core:database/core:network hit) -- move to a new nonWebTest source set; confirmed empirically that core:data's own compileTestKotlinWasmJs task genuinely needs every commonTest dependency to resolve, even with no browser()/nodejs() test executor configured -- this is a real compile-time constraint on every module, not something a bare wasmJs() sidesteps by omission. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
:core:data
Overview
The :core:data module holds the concrete implementations of the :core:repository contracts, serving as the primary data source for ViewModels in feature modules. It orchestrates data flow between the local database (core:database), remote services, and network repositories.
Key Components
1. Repository implementations (repository/)
NodeRepositoryImpl: High-level access to node information and mesh state (Room KMP backed).MeshLogRepositoryImpl: Access to historical logs and diagnostics.FirmwareReleaseRepositoryImpl: Manages the discovery and retrieval of firmware updates.
2. Manager implementations (manager/)
SessionManagerImpl: Per-node remote-admin passkey store.PacketHandlerImpl/MeshMessageProcessorImpl: Inbound mesh packet handling and message processing.
Dependency Graph
graph TB
:core:data[data]:::kmp-library
:core:data --> :core:repository
:core:data -.-> :core:common
:core:data -.-> :core:database
:core:data -.-> :core:datastore
:core:data -.-> :core:di
:core:data -.-> :core:model
:core:data -.-> :core:network
:core:data -.-> :core:prefs
:core:data -.-> :core:takserver
:core:data -.-> :core:testing
classDef android-application fill:#CAFFBF,stroke:#000,stroke-width:2px,color:#000;
classDef android-application-compose fill:#CAFFBF,stroke:#000,stroke-width:2px,color:#000;
classDef compose-desktop-application fill:#CAFFBF,stroke:#000,stroke-width:2px,color:#000;
classDef android-feature fill:#FFD6A5,stroke:#000,stroke-width:2px,color:#000;
classDef android-library fill:#9BF6FF,stroke:#000,stroke-width:2px,color:#000;
classDef android-library-compose fill:#9BF6FF,stroke:#000,stroke-width:2px,color:#000;
classDef android-test fill:#A0C4FF,stroke:#000,stroke-width:2px,color:#000;
classDef jvm-library fill:#BDB2FF,stroke:#000,stroke-width:2px,color:#000;
classDef kmp-feature fill:#FFD6A5,stroke:#000,stroke-width:2px,color:#000;
classDef kmp-library-compose fill:#FFC1CC,stroke:#000,stroke-width:2px,color:#000;
classDef kmp-library fill:#FFC1CC,stroke:#000,stroke-width:2px,color:#000;
classDef unknown fill:#FFADAD,stroke:#000,stroke-width:2px,color:#000;