Skip to content

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
awad/js-126-feedback-error-rejections-breaking
Draft

fix(feedback)!: always reject sendFeedback with an Error#20475
logaretm wants to merge 6 commits intoawad/js-126-allow-error-messages-to-be-customizedfrom
awad/js-126-feedback-error-rejections-breaking

Conversation

@logaretm
Copy link
Copy Markdown
Member

sendFeedback currently rejects with an Error in some paths and a raw string in others. This normalizes all paths to reject with an Error, which is the expected shape and easier to handle for consumers.

Breaking: intended for the next major.

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>
@linear-code
Copy link
Copy Markdown

linear-code Bot commented Apr 24, 2026

@logaretm logaretm changed the title feat(feedback)!: always reject sendFeedback with an Error fix(feedback)!: always reject sendFeedback with an Error Apr 24, 2026
@logaretm logaretm changed the base branch from develop to awad/js-126-allow-error-messages-to-be-customized April 24, 2026 03:06
@logaretm logaretm added this to the 11.0.0 milestone Apr 24, 2026
- 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>
@logaretm logaretm force-pushed the awad/js-126-feedback-error-rejections-breaking branch from 29f92e6 to 90ef1af Compare April 24, 2026 03:14
…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>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 24, 2026

size-limit report 📦

Path Size % Change Change
@sentry/browser 25.88 kB added added
@sentry/browser - with treeshaking flags 24.35 kB added added
@sentry/browser (incl. Tracing) 43.8 kB added added
@sentry/browser (incl. Tracing + Span Streaming) 45.5 kB added added
@sentry/browser (incl. Tracing, Profiling) 48.73 kB added added
@sentry/browser (incl. Tracing, Replay) 82.98 kB added added
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 72.5 kB added added
@sentry/browser (incl. Tracing, Replay with Canvas) 87.67 kB added added
@sentry/browser (incl. Tracing, Replay, Feedback) 100.27 kB added added
@sentry/browser (incl. Feedback) 43.09 kB added added
@sentry/browser (incl. sendFeedback) 30.68 kB added added
@sentry/browser (incl. FeedbackAsync) 35.84 kB added added
@sentry/browser (incl. Metrics) 27.16 kB added added
@sentry/browser (incl. Logs) 27.29 kB added added
@sentry/browser (incl. Metrics & Logs) 27.98 kB added added
@sentry/react 27.62 kB added added
@sentry/react (incl. Tracing) 46.05 kB added added
@sentry/vue 30.71 kB added added
@sentry/vue (incl. Tracing) 45.62 kB added added
@sentry/svelte 25.89 kB added added
CDN Bundle 28.57 kB added added
CDN Bundle (incl. Tracing) 46.08 kB added added
CDN Bundle (incl. Logs, Metrics) 29.95 kB added added
CDN Bundle (incl. Tracing, Logs, Metrics) 47.12 kB added added
CDN Bundle (incl. Replay, Logs, Metrics) 68.92 kB added added
CDN Bundle (incl. Tracing, Replay) 83.14 kB added added
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 84.17 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback) 88.95 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 90 kB added added
CDN Bundle - uncompressed 83.59 kB added added
CDN Bundle (incl. Tracing) - uncompressed 137.62 kB added added
CDN Bundle (incl. Logs, Metrics) - uncompressed 87.73 kB added added
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 141.03 kB added added
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 211.31 kB added added
CDN Bundle (incl. Tracing, Replay) - uncompressed 255.06 kB added added
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 258.46 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 268.76 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 272.14 kB added added
@sentry/nextjs (client) 48.58 kB added added
@sentry/sveltekit (client) 44.22 kB added added
@sentry/node-core 58.35 kB added added
@sentry/node 175.67 kB added added
@sentry/node - without tracing 98.3 kB added added
@sentry/aws-serverless 115.33 kB added added

@logaretm logaretm force-pushed the awad/js-126-feedback-error-rejections-breaking branch from 90ef1af to c6d759f Compare April 24, 2026 03:40
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@logaretm logaretm force-pushed the awad/js-126-feedback-error-rejections-breaking branch from c6d759f to 44d8d3c Compare April 24, 2026 04:08
logaretm and others added 2 commits April 24, 2026 02:18
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>
@logaretm logaretm force-pushed the awad/js-126-feedback-error-rejections-breaking branch from 44d8d3c to fdc6ca4 Compare April 24, 2026 06:18
@logaretm logaretm force-pushed the awad/js-126-allow-error-messages-to-be-customized branch from dadaa16 to 90ec385 Compare April 24, 2026 08:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant