Skip to content

fix: log removeDevice failures during removeConnection with structured error fields#1298

Draft
danditomaso with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-comments-in-review-thread
Draft

fix: log removeDevice failures during removeConnection with structured error fields#1298
danditomaso with Copilot wants to merge 2 commits into
mainfrom
copilot/fix-comments-in-review-thread

Conversation

Copilot AI commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Description

removeConnection swallowed removeDevice errors in a bare catch {}, hiding failures silently. This PR adds a log.warn with structured error fields, and reformats an overly long chained call for readability.

Related Issues

Changes Made

  • removeConnection catch block: replaced catch {} with structured error logging — extracts err.name / err.message instead of passing the raw err object (which serializes to {} in JSON-based loggers), consistent with error handling in teardown() and connect():
} catch (e) {
  const err = e as Error;
  log.warn("removeDevice failed during removeConnection", {
    id,
    meshDeviceId: conn.meshDeviceId,
    name: err?.name,
    message: err?.message,
  });
}
  • connect: reformatted long useDeviceStore.getState().savedConnections.find(...) chain across multiple lines

Testing Done

Verified no TypeScript or CodeQL errors introduced. Pattern matches existing error logging callsites in the same file.

Screenshots (if applicable)

Checklist

  • Code follows project style guidelines
  • Documentation has been updated or added
  • Tests have been added or updated
  • All i18n translation labels have been added (read
    CONTRIBUTING_I18N_DEVELOPER_GUIDE.md for more details)

@vercel

vercel Bot commented Jul 14, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
web-test Ready Ready Preview, Comment Jul 14, 2026 2:03am

Request Review

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
Copilot AI changed the title [WIP] Fix code based on review comments fix: log removeDevice failures during removeConnection with structured error fields Jul 14, 2026
Copilot AI requested a review from danditomaso July 14, 2026 02:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants