* web: refactor 6/7 node page
* web: address node-page refactor review and close coverage gaps
Fix the concurrency cap in fetchNodeDetailsIntoIndex so it actually
limits in-flight requests. The previous implementation built each
fetch as an immediately-invoked async IIFE, so all N fetches started
the moment the loop ran; the slicing-then-Promise.all step only
changed when settlement was observed, not when work began. Replace
the IIFE-then-batch pattern with a worker pool: a fixed-size set of
worker promises iterates a shared queue and only pulls the next
identifier once the previous fetch settles.
Reduce cross-module coupling around the role-aware short-name badge
by extracting renderRoleAwareBadge into a new badge.js module that
single-node-table, messages, detail-html, and traces import directly,
so the neighbour module is no longer pulled in by four non-neighbour
callers. Tighten applyDetails in role-index.js by hoisting the
ternary into a single key binding and dropping the redundant
instanceof Map guard.
Close the patch-coverage gap reported by Codecov: add tests for
parameter-validation paths in bootstrap (parseReferencePayload,
normalizeNodeReference, fetchNodeDetailHtml, initializeNodeDetailPage),
the worker-pool branches in role-index (no-fetch, empty queue, 404,
non-success responses, and an explicit concurrency-cap assertion),
the badge fallback path, the nested-neighbor seedNeighborRoleIndex
branches, the renderNeighborBadge metadata-merge and short-name
fallback paths, the empty-trace and empty-chart short-circuits, and
single-node-table validation. All ten node-page submodules now
report 100% line coverage.
* data: refactor 4/7 interfaces
* data: address PR #775 review feedback
Fix the two CI test regressions caused by the package split:
- ``factory._load_ble_interface`` no longer keeps a stale module-level
``BLEInterface`` cache that survived ``monkeypatch`` teardown across
tests. The package-level attribute is now the single cache; the
``factory.py`` global was removed. This unblocks
``test_load_ble_interface_sets_global``.
- ``interfaces/__init__.py`` re-resolves ``SerialInterface`` and
``TCPInterface`` from ``meshtastic.*`` at package-load time so that a
test that pops ``data.mesh_ingestor.interfaces`` from ``sys.modules``
and re-imports picks up the freshly registered classes rather than
whatever a cached ``factory.py`` first resolved. This unblocks
``test_interfaces_patch_handles_preimported_serial``.
Restore 100% patch coverage on the interfaces subpackage by:
- Adding tests for previously uncovered, testable paths:
``_extract_host_node_id(None)``, ``_ensure_channel_metadata``,
``_normalise_nodeinfo_packet`` (None input + dict-conversion fallback),
``_resolve_lora_message`` (radio_section paths), ``_modem_preset``
(preset attr fallback + unparseable value), ``_camelcase_enum_name``
separator-only input, ``_region_frequency`` no-digit enum name,
``_ensure_radio_metadata`` unresolvable-message path, plus the
unknown-section recursive branch of ``_candidate_node_id``.
- Marking genuinely unreachable defensive branches with
``pragma: no cover`` (BLE receive loop body, upstream API regression
guards, patch re-entry guard, unreachable ``NoAvailableMeshInterface``
fallback).
* web: refactor 7/7 main js
* web: refactor 7/7 main js
* web: address review feedback on 7/7 main.js refactor
* Consolidate the duplicate ./main/format-utils.js import block in
main.js so all symbols come from a single, alphabetised import
statement (review item: "Important — Duplicate format-utils.js
import block").
* Replace the leftover stale JSDoc atop +createOfflineTileLayer+ with
one clear "do not inline" DI block, and likewise expand the
+fetchMessages+ wrapper docstring so future readers see the shim's
purpose without hunting for the implementation (review nit:
"thin wrappers ... worth a one-line JSDoc").
* Add per-module unit tests under
public/assets/js/app/main/__tests__/ covering every previously-
uncovered branch in the 9 modules codecov flagged: tile-coords,
sort-comparators, fullscreen-helpers, format-utils, data-fetchers,
data-merge, tooltip-html, long-link-router, and offline-tile-layer.
This drives the codecov patch percentage on PR #778 from 78.99%
to ~100% on the new modules and unblocks the codecov/patch gate.
JS suite: 1,114 tests, 0 failures.
* web: refactor 5/7 node page charts
* web: address review feedback on node-page-charts split
* Drop the local stringOrNull/numberOrNull copies from node-page.js
and import them from ./value-helpers.js so the shared module's
stated dedup actually happens (review issue #1). The two locals
were byte-identical to the new shared module.
* Split the display-only formatters out of
node-page-charts/format-utils.js into a sibling
node-page-charts/display-formatters.js so format-utils.js carries
only chart concerns (review issue #2). The barrel
node-page-charts.js re-exports both files so existing callers and
tests keep working unchanged.
* Inline +fmtCurrent+ in node-page-charts/specs.js and drop the
sideways import from short-info-telemetry.js so node-page-charts/
no longer depends on an unrelated module (review issue #3).
* Add a dedicated value-helpers.test.js pinning the contract of
+numberOrNull+ and +stringOrNull+ so they stop relying on
transitive coverage from the chart suite (review issue #5).
* web: refactor 2/7 federation
* web: close federation coverage gaps and apply review nits
Address Codecov patch coverage feedback by adding rspec examples for
the 51 lines flagged across the new federation shards (announce,
crawl, validation, http_client, self_instance, instance_metrics,
announcer_threads, lifecycle, signature). Per-shard line coverage in
the federation directory is now 100%.
Apply two review-comment changes: rename the awkwardly-named
http_client_get.rb to instance_fetcher.rb (matching its semantic
role rather than the HTTP verb), and declare PotatoMesh::App::Federation
explicitly in the federation.rb manifest so the namespace is owned by
this file rather than implicitly created by whichever shard happens to
load first.
* web: refactor 1/7 data processing
* web: close coverage gaps in data_processing submodules
Bring every file under lib/potato_mesh/application/data_processing/ to
100% line coverage so codecov/patch passes on the 1/7 refactor PR. The
gap was a relocation of pre-existing untested branches; closing them
here keeps the subsequent refactor PRs in the series unblocked.
* Add unit tests covering canonical sender/recipient overrides,
reply_id/emoji updates on existing rows, and the rare INSERT
ConstraintException recovery path inside +insert_message+.
* Cover the non-canonical reporter and per-neighbour resolution
branches in +insert_neighbors+.
* Cover the SQLException rescue in +upsert_ingestor+, the
fallback_num branch in +touch_node_last_seen+, the limit fallback
in +read_json_body+, the unrecognised-type branch in
+store_decrypted_payload+, the +power+ telemetry_type fallback,
the default-coercion path in +resolve_numeric_metric+, and the
numeric/bare-hex paths in +canonical_node_parts+ and
+coerce_trace_node_id+.
Drop dead code surfaced while pinning behaviour:
* +clear_encrypted+ in +insert_message+ has been initialised to
+false+ and never reassigned since #633 dropped the
decrypted-text override; remove it and the four dependent
branches.
* The +rescue ArgumentError; nil+ tails in
+identity.resolve_node_num+ and +traces.coerce_trace_node_id+ are
unreachable because every +Integer(...)+ call inside is guarded by
a regex pre-check.
Add a comment to the +data_processing.rb+ shim explaining that the
+require_relative+ list is ordered by dependency rather than
alphabetically, addressing review nit #5.
* data: refactor 3/7 protocols
* data: address PR #774 review feedback
- Rewrite the parents[4] path comment in protocols/meshcore/debug_log.py
to clearly explain why the index changed from parents[3] (the original
pre-split index) without contradicting the code.
- Add tests covering the six lines flagged uncovered by codecov:
* _process_self_info host-position branch (handlers.py:78)
* on_contact_msg early-return for missing text/sender_ts (handlers.py:278)
* close() RuntimeError swallow when loop closes mid-call (interface.py:155-156)
* _run_meshcore wrapper around _ensure_channel_names failure (runner.py:131-132)
Restores 100% patch coverage on the meshcore package.
Backfill v0.6.1 CHANGELOG entry (previously undocumented),
add v0.6.2 entry covering 9 commits since v0.6.1, and bump
the version string across data, web, matrix, and app along
with the README docker-pull examples.
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* web: fix federation for multi protocol
* web: fix short name emojis
* web: address review comments
* ci: fix the codeql gap
* ci: fix the codeql gap
* ci: fix the codeql gap
* ci: remove swift
* web: reference meshcore nodes in chat
* data: add adv_name to messages
* web: address review comments
* derive actual companion from name string
* derive actual companion from name string
* derive actual companion from name string
* web: address review comments
* web: address review comments
* chore: bump version to 0.6.0 and remove deprecated env var aliases
BREAKING CHANGES:
- POTATOMESH_INSTANCE removed — use INSTANCE_DOMAIN
- PROVIDER removed — use PROTOCOL
- MESH_SERIAL removed — use CONNECTION
- PORT config alias removed — use CONNECTION
The _ConfigModule proxy class (which kept PROTOCOL/PROVIDER and
CONNECTION/PORT in sync) is deleted. docker-compose.yml now defaults
INSTANCE_DOMAIN to http://web:41447 so deployments without an explicit
value continue to work.
* tests: run black
* address review comments
Replace the hardcoded max_idx=8 parameter on _ensure_channel_names with
a DEVICE_INFO query (send_device_query → max_channels) so the full range
of configured channels is always probed regardless of firmware variant.
Falls back to _CHANNEL_PROBE_FALLBACK_MAX (32) when the query fails or
the device returns an older firmware that omits max_channels.
Also removes always=True from the warning-severity channel failure log
(redundant — only debug-severity is gated behind the DEBUG flag) and adds
a deferred-import comment in _ensure_channel_names.
* data: register meshcore channel mappings
* fix: use mc.commands.get_channel for MeshCore channel name probing
MeshCore exposes device commands via the commands sub-object
(CommandHandler), not directly on MeshCore instances.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
* fix: probe all channel indices regardless of ERROR responses
Removed the consecutive-error early-stop heuristic from
_ensure_channel_names so sparse channel configurations (e.g. slots 0
and 5 configured with slots 1–4 empty) are fully probed. Only a hard
exception aborts the loop early.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
---------
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
* data: provide frequency and modem preset for meshcore
* data: provide frequency and modem preset for meshcore
* ingestor: address review comments
* fix: remove duplicate _mark_packet_seen entry from handlers __all__
* ci: install meshcore in Python workflow
protocols/meshcore.py now imports meshcore at module level (required to
fix a self-referential import failure after the providers/ → protocols/
rename). test_provider_unit.py imports that module unconditionally, so
meshcore must be present in the test environment.
* data: run black