fix: address 2.8.0 release-audit findings#6189
Conversation
- Confirm deep-link connect/disconnect requests before re-pointing the radio (the connections path is a verified meshtastic.org app link, so any web page can fire one); gate MOCK/REPLAY addresses on debug builds - Swap the ktor Android engine for OkHttp: the platform's bundled okhttp 2.x fork behind HttpURLConnection crashes with "Unbalanced enter/exit" when a request cancels mid-body (Crashlytics 97ae5ea1, new in 2.8.0) - Merge quick_chat actions during cross-transport DB unification before the source database is retired - Dedupe discovered TCP devices by address (LazyColumn duplicate-key crash on re-announced mDNS services) - Reject digit-led sibling variants in firmware filename validation (tlora-v2 no longer matches tlora-v2-1-1_6 images) - Pre-S: surface ACCESS_FINE_LOCATION as the Bluetooth scan permission so a declined grant is re-promptable instead of an empty device list - Localize hardcoded PM/CO2/current/voltage labels; show 0 degree temperature readings (null already means absent) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe PR switches the Android HTTP client to OkHttp, updates connectivity handling, merges quick-chat actions between databases, tightens firmware filename matching, adds deep-link confirmation dialogs, and adjusts sensor and metric presentation. ChangesNetwork and runtime connectivity
Connection discovery and deep links
Quick-chat database merging
Firmware filename validation
Sensor and metrics presentation
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant ConnectionsNavigation
participant MeshtasticDialog
participant scanModel
User->>ConnectionsNavigation: open connection deep link
ConnectionsNavigation->>MeshtasticDialog: show connect or disconnect confirmation
User->>MeshtasticDialog: confirm or dismiss
MeshtasticDialog->>ConnectionsNavigation: return action
ConnectionsNavigation->>scanModel: changeDeviceAddress or disconnect
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
feature/node/src/commonMain/kotlin/org/meshtastic/feature/node/metrics/PowerMetrics.kt (1)
324-332: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winApply the same
MetricFormatter.voltagefix to the end-axis label.The marker formatter above was just fixed to use
MetricFormatter.voltage(value.toFloat(), 1)instead of manual" V"concatenation, but the end-axisvalueFormattera few lines below still uses the old pattern. Same value, same screen, inconsistent formatting/unit-localization.♻️ Proposed fix
endAxis = if (voltageData.isNotEmpty()) { VerticalAxis.rememberEnd( label = ChartStyling.rememberAxisLabel(color = voltageColor), - valueFormatter = { _, value, _ -> "${NumberFormatter.format(value.toFloat(), 1)} V" }, + valueFormatter = { _, value, _ -> MetricFormatter.voltage(value.toFloat(), 1) }, ) } else { null },As per coding guidelines, "Use
MetricFormatterfromcore:commonfor display strings (temperature, voltage, percent, signal). Avoid scatteredformatString("%.1f°C", val)calls."🤖 Prompt for 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. In `@feature/node/src/commonMain/kotlin/org/meshtastic/feature/node/metrics/PowerMetrics.kt` around lines 324 - 332, Update the end-axis valueFormatter in the voltageData branch of PowerMetrics to call MetricFormatter.voltage(value.toFloat(), 1) instead of NumberFormatter.format(...)+manual " V" concatenation, matching the marker formatter and localized voltage formatting.Source: Coding guidelines
🤖 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.
Nitpick comments:
In
`@feature/node/src/commonMain/kotlin/org/meshtastic/feature/node/metrics/PowerMetrics.kt`:
- Around line 324-332: Update the end-axis valueFormatter in the voltageData
branch of PowerMetrics to call MetricFormatter.voltage(value.toFloat(), 1)
instead of NumberFormatter.format(...)+manual " V" concatenation, matching the
marker formatter and localized voltage formatting.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 7de8e8e7-6de2-4039-8a70-ebd31d9ff9d8
📒 Files selected for processing (16)
.skills/compose-ui/strings-index.txtandroidApp/build.gradle.ktsandroidApp/src/main/kotlin/org/meshtastic/app/di/NetworkModule.ktcore/database/src/commonMain/kotlin/org/meshtastic/core/database/DatabaseMerger.ktcore/database/src/commonMain/kotlin/org/meshtastic/core/database/dao/QuickChatActionDao.ktcore/network/src/commonMain/kotlin/org/meshtastic/core/network/radio/BaseRadioTransportFactory.ktcore/resources/src/commonMain/composeResources/values/strings.xmlcore/ui/src/androidMain/kotlin/org/meshtastic/core/ui/util/PlatformUtils.ktcore/ui/src/commonMain/kotlin/org/meshtastic/core/ui/component/NodeItem.ktfeature/connections/src/commonMain/kotlin/org/meshtastic/feature/connections/domain/usecase/TcpDiscoveryHelpers.ktfeature/connections/src/commonMain/kotlin/org/meshtastic/feature/connections/navigation/ConnectionsNavigation.ktfeature/firmware/src/commonMain/kotlin/org/meshtastic/feature/firmware/FirmwareFileHandler.ktfeature/firmware/src/commonTest/kotlin/org/meshtastic/feature/firmware/IsValidFirmwareFileTest.ktfeature/node/src/commonMain/kotlin/org/meshtastic/feature/node/metrics/AirQualityMetrics.ktfeature/node/src/commonMain/kotlin/org/meshtastic/feature/node/metrics/PowerMetrics.ktgradle/libs.versions.toml
Matches the marker formatter fixed in the previous commit; the axis label was still hand-concatenating " V". Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Regression test for the distinctBy fix: duplicate mDNS announcements for the same host/port must collapse to one device entry. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Why
A full audit of the v2.7.14..HEAD range (387 commits) ahead of the 2.8.0 public release surfaced a short punch list: one web-reachable security gap, one fatal crash new to the 2.8.0 line, two correctness bugs in systems introduced this cycle, and localization/permission polish. This PR lands the review-sized items in one pass so they're in before 2.8.0 promotes out of closed testing.
What
🐛 Bug Fixes
connections?address=…is a verifiedmeshtastic.orgapp link, so any web page could silently re-point the app at an arbitrary (including attacker-hosted TCP) address or force a disconnect. Deep-link-originated changes now show a confirm dialog, and MOCK/REPLAY addresses are gated on debug builds inBaseRadioTransportFactory(the base class short-circuited them to valid before the platform check ran).97ae5ea1, builds 29321237–29321401). TheAndroidengine ridesHttpURLConnection, whose AOSP-bundled okhttp 2.x fork throwsIllegalStateException: Unbalanced enter/exitwhen a request is cancelled mid-body — amplified by the retry-on-timeout policy from fix(network): retry transient connection/IO failures to api.meshtastic.org #5870. This stays entirely within ktor: only the engine artifact changes; client config, plugins, andktor-networkare untouched.quick_chatduring cross-transport DB unification (feat(database): unify device database across transports #6096 follow-up). The one-time merge folded every per-device table except quick-chat actions, then deleted the source DB — multi-transport users lost their buttons. Dedupes on name+message+mode and appends with fresh ids.fullAddressentries and a hard LazyColumn duplicate-key crash (tcp-discovered:variant of Crashlytics159e2535).firmware-tlora-v2-1-1_6-2.7.14.binvalidated for targettlora-v2, so the feat(firmware): Confirm local firmware files before flashing #6083 confirm gate could pass a wrong-variant image. The post-target token must now be a dotted version or the literalfirmware.🧹 Chores
Testing Performed
IsValidFirmwareFileTest:rejects digit-led sibling variants(verified to fail against the old regex) andaccepts a v-prefixed version after the target.spotlessApply spotlessCheck detekt assembleDebug test allTests(both flavors).🤖 Generated with Claude Code
Summary by CodeRabbit