fix: log removeDevice failures during removeConnection#1283
fix: log removeDevice failures during removeConnection#1283danditomaso wants to merge 2 commits into
Conversation
Bare catch {} on line 89 hid any failure from the device store's
removeDevice call, leaving cleanup partially completed with no signal
in the logs. Log at warn level with the connection + device id and the
error.
Closes meshtastic#1272
|
@danditomaso is attempting to deploy a commit to the Meshtastic Team on Vercel. A member of the Team first needs to authorize it. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthrough
ChangesConnection error handling
Estimated code review effort: 2 (Simple) | ~5 minutes Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 3 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (3 passed)
Comment |
There was a problem hiding this comment.
Pull request overview
Improves connection cleanup diagnostics by no longer silently swallowing device-store removal errors during removeConnection, aligning behavior with the intent of issue #1272.
Changes:
- Log a
warnwhenremoveDevice()throws duringremoveConnection, including connection/device identifiers. - Reformat the
connect()lookup to readsavedConnectionsfrom the live store with clearer chaining.
| } catch (err) { | ||
| log.warn("removeDevice failed during removeConnection", { | ||
| id, | ||
| meshDeviceId: conn.meshDeviceId, | ||
| err, | ||
| }); | ||
| } |
Apply reviewer feedback from PR #1283 review: - Log err.name and err.message instead of raw err object to avoid {} serialization in JSON-based loggers, consistent with teardown() and connect() error handling patterns in the same file - Reformat long chained call in connect() for readability
Closes #1272.
removeConnectioninapps/web/src/pages/Connections/useConnections.tswrappeduseDeviceStore.getState().removeDevice(...)in a barecatch {}, hiding failures and leaving the device store partially cleaned up with no diagnostic. Log atwarnwith the connection id, mesh device id, and the error.Test plan
Summary by CodeRabbit