Forward errorMessage in WebExtensionApiRequest telemetry#1572
Merged
amitjoshi438 merged 2 commits intomainfrom May 4, 2026
Merged
Forward errorMessage in WebExtensionApiRequest telemetry#1572amitjoshi438 merged 2 commits intomainfrom
amitjoshi438 merged 2 commits intomainfrom
Conversation
sendAPITelemetry already accepts errorMessage but never adds it to the telemetry properties object, so all WebExtensionApiRequestFailure events land in Kusto without the underlying error detail. The save flow already constructs a useful message via createHttpResponseError / formatHttpErrorMessage (with the truncated Dataverse response body), but that information is lost in flight. Add errorMessage as an optional property on IWebExtensionAPITelemetryData and have sendAPITelemetry write it to properties only when present (so success-path events stay clean). Defensive 500-char cap matches the existing formatHttpErrorMessage limit, in case a non-HTTP caller passes an unbounded raw error.message. Unblocks RCA on the dominant save 400 class (~1,892/30d) by exposing the OData error code in telemetry. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
priyanshu92
approved these changes
Apr 29, 2026
Companion to the previous commit. The integration test asserts on the exact properties shape passed to traceError; now that errorMessage lands in properties when provided, the expected object needs the field too. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
priyanshu92
approved these changes
May 4, 2026
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
sendAPITelemetrydiscardserrorMessagetoday: the parameter is accepted and used to build atraceErrorinvocation, but it never lands inproperties, so everyWebExtensionApiRequestFailureevent in Kusto is missing the underlying error detail (status text, response body, OData error code).createHttpResponseError/formatHttpErrorMessage(with the truncated Dataverse response body) and forwards it throughsendAPIFailureTelemetry->sendAPITelemetry. This PR plumbs that string into the telemetry payload.errorMessage?: stringtoIWebExtensionAPITelemetryData.properties.sendAPITelemetrynow sets the field only when present (so success-path events stay clean) and applies a defensive 500-char cap for non-HTTP callers that may pass a raw unboundederror.message.Test plan
npm test(unit, blast-radius check) - 95/95 passing locallynpm run test-web-integration- blocked locally by VS Code Insiders editor lock; CI should run cleanlysendAPITelemetry_whenErrorMessageIsPassed_shouldCallSendTelemetryExceptionupdated to asserterrorMessageis now inpropertiessendAPITelemetry_whenErrorMessageNotPassed_shouldCallSendTelemetryExceptionunchanged (validateserrorMessageis omitted when not provided)WebExtensionApiRequestFailureevents should carry non-emptyerrorMessagecontaining the truncated response body for HTTP failures