Repository navigation
fix(trace): stop mis-parsing ROUTING_APP as RouteDiscovery - #3
Merged
Merged
Conversation
wantResponse failures can arrive as ROUTING_APP (nested route_request), which DecodeError'd when parsed as RouteDiscovery and surfaced as "Trace fehlgeschlagen: Error parsing message...". Prefer predecoded traceroute dicts, map routing errors to short DE replies, and add unittest coverage without radio. Co-authored-by: chrishaefner <chrishaefner@outlook.de>
|
Danke für den Pull Request! Kurzchecklist: Fokus halten, keine Secrets committen, bei Verhaltens-/Config-Änderungen README oder Leitfaden: CONTRIBUTING.md. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
!traceincreasingly failed with:Trace fehlgeschlagen: Error parsing message with type 'meshtastic.protobuf.RouteDiscovery'Root cause:
format_traceroute_packetalways ranRouteDiscovery.ParseFromStringondecoded.payload. TraceroutewantResponsefailures often arrive as ROUTING_APP. ARoutingmessage with nestedroute_request(length-delimited field 1) is not validRouteDiscoverywire data (field 1 = repeated fixed32), so protobuf raisesDecodeError/ “Wire format was corrupt”. That exception was wrapped by_run_trace_jobinto the German “Trace fehlgeschlagen” string.Same class of bug as upstream meshtastic/python#930. Reproduced with
meshtastic==2.7.11+protobuf7.x.Fix (
modules/trace.py):ROUTING_APPand return a short DE routing-error DM (never parse asRouteDiscovery)decoded.traceroutewhen presentDecodeError→ clear DE “Antwort unlesbar” message (no raw protobuf text to users)Tests:
modules/test_trace.py(mock packets, no radio)Test plan
python3 -m unittest modules.test_trace -v!traceon a live node after deploy (success path + unreachable / MAX_RETRANSMIT)config.template— N/A (behaviour-only; CHANGELOG updated)config.iniincludedNotes / caveats
requirements.txtleavesmeshtasticunpinned; keep the Python lib roughly aligned with node firmware /meshtasticd.FromRadioframes when debug-log-over-API is enabled can also cause protobuf parse errors — this PR only hardens the bot’s traceroute decode path.