Repository navigation
[LWDM] feat(device-intent): send secure channel error types (LIVE-42639) - #25752
OlivierFreyssinet wants to merge 3 commits into
Conversation
There was a problem hiding this comment.
🔵 Needs a closer look
Both wallet apps rely on an unreleased DMK snapshot, requiring maintainer confirmation of its released replacement and validation of device-flow compatibility before merge.
No open issues 🎉
1 file not reviewed
pnpm-lock.yaml: Generated file
What changed in this PR
This PR refines device-flow failure analytics for Ledger Wallet, building on #25748 to distinguish secure-channel network and server failures while preserving wrapped device-error causes.
Changes:
- Replaces
ServerOrNetworkwith DMK’s typed secure-channel causes and updates regression tests. - Aligns workspace dependencies on the DMK snapshot and explicitly declares DMK for desktop end-to-end tests.
- Adds release notes for the shared library and both apps.
The PR description identifies the DMK snapshot as temporary and requires a released version before merging.
| File | Description |
|---|---|
pnpm-workspace.yaml |
Pins DMK to the snapshot providing secure-channel error types. |
pnpm-lock.yaml |
Updates DMK resolutions and dependent peer references. |
libs/live-dmk-shared/src/deviceIntentTracking/deviceFlowFailure.ts |
Reports typed secure-channel causes while preserving wrapped error tags. |
libs/live-dmk-shared/src/deviceIntentTracking/deviceFlowFailure.test.ts |
Tests typed causes, the unknown fallback, and analytics properties. |
e2e/desktop/package.json |
Declares DMK to align the mockserver client’s peer dependency. |
.changeset/brave-sockets-split.md |
Records minor releases for the shared library and both apps. |
Review effort: Balanced
# Conflicts: # libs/live-dmk-shared/src/deviceIntentTracking/deviceFlowFailure.test.ts # libs/live-dmk-shared/src/deviceIntentTracking/deviceFlowFailure.ts
d67151f to
d76d8e2
Compare
🟢 Architecture score: 100%+0 lines in the new layers (
|
Web Tools Build Status
|
Rsdoctor Bundle Diff AnalysisFound 7 projects in monorepo, 3 projects with changes. 📊 Quick Summary
📋 Detailed Reports (Click to expand)📁 desktop-mainPath:
📦 Download Diff Report: desktop-main Bundle Diff 📁 desktop-rendererPath:
📦 Download Diff Report: desktop-renderer Bundle Diff 📁 mobilePath:
📦 Download Diff Report: mobile Bundle Diff Generated by Rsdoctor GitHub Action |
|
📝 Description
Problem: #25748 (subError cause) sends
subErrorCauseforSecureChannelError. With DMK 1.13.0, a WebSocket error, anERRORmessage from the HSM, an unexpected close and invalid server data carry only free text, so they all send the same value:ServerOrNetwork. We cannot tell a network failure from a server error, andSecureChannelErroris the most common device flow failure (1,177 events from 848 users on LWM 4.29.0, 19–30 Nov 2026).Solution: DMK now gives each cause its own string
errorType, in the exportedSecureChannelErrorTypeenum (LedgerHQ/device-sdk-ts#2262).subErrorCausereads it:subErrorCauseDeviceDisconnectedWhileSendingError,AlreadySendingApduError…WebSocketErrorWebSocketClosedERRORmessageServerErrorInvalidServerMessage,InvalidServerDataInvalidConnectionUnknownStatusWordUnknownServerOrNetworkis gone. If this PR and #25748 ship in the same release, that value never reaches production. The cause still comes from typed fields only (the DMK_tag, the nested error's_taganderrorType, checked against the enum), never from a message or a URL.DMK errors are now matched by
_tagand fields, notinstanceof, for every cause:SecureChannelError,UnknownDeviceExchangeError, and exchange errors (identified by theirerrorCode, since each subclass sets its own_tag).instanceoffails when the app loads a second DMK copy, for example the ESM and the CJS builds of the same version, and the cause would then disappear from the event.{ "failureType": "ConnectAppError", "subError": "SecureChannelError", "subErrorCause": "ServerError", "modelId": "nanoX", "transport": "ble" }DMK: develop already pins
@ledgerhq/device-management-kit1.14.0 (#25761), the release of LedgerHQ/device-sdk-ts#2262, so this PR does not change dependencies.🔗 Context