fix(feedback)!: always reject sendFeedback with an Error#20475
Draft
logaretm wants to merge 6 commits intoawad/js-126-allow-error-messages-to-be-customizedfrom
Draft
fix(feedback)!: always reject sendFeedback with an Error#20475logaretm wants to merge 6 commits intoawad/js-126-allow-error-messages-to-be-customizedfrom
logaretm wants to merge 6 commits intoawad/js-126-allow-error-messages-to-be-customizedfrom
Conversation
Adds five new text options (errorEmptyMessageText, errorNoClientText, errorTimeoutText, errorForbiddenText, errorGenericText) to FeedbackTextConfiguration so consumers can translate or reword the widget's error messages. sendFeedback now throws/rejects with stable codes (typed via FeedbackErrorCode) and the widget maps those codes to the configured text. Closes #14687 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Form: use ?? so empty-string text overrides are respected (Copilot) - constants: grammar fix "with an empty message" (Copilot) - sendFeedback: clean up afterSendEvent listener on timeout to avoid leak (Copilot) - tests: cover empty-message and no-client early-return paths (Copilot) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
29f92e6 to
90ef1af
Compare
…messages Addresses review feedback that sendFeedback (a public API) was rejecting with internal codes instead of human-readable strings, changing observable behavior for non-widget consumers. sendFeedback now accepts optional errorMessages overrides via its hint argument, defaulting to the original English strings. The widget wraps sendFeedback to inject its configured text options, so standalone consumers of sendFeedback see the same strings as before. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
size-limit report 📦
|
90ef1af to
c6d759f
Compare
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
c6d759f to
44d8d3c
Compare
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Previously, sendFeedback's async rejection paths (timeout, 403, generic transport error) rejected with plain strings, while the sync-throw paths used Error instances. Unify on Error for all paths so consumers can rely on a consistent rejection shape. BREAKING CHANGE: sendFeedback now always rejects with an Error whose .message is the error code (ERROR_TIMEOUT, ERROR_FORBIDDEN, or ERROR_GENERIC). Previously these paths rejected with the raw string. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
44d8d3c to
fdc6ca4
Compare
dadaa16 to
90ec385
Compare
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.
sendFeedbackcurrently rejects with anErrorin some paths and a raw string in others. This normalizes all paths to reject with anError, which is the expected shape and easier to handle for consumers.Breaking: intended for the next major.