Repository navigation
fix: identify and updateContact reject with an Error; version 19.9.1 - #231
Merged
Merged
Conversation
Failed identify, updateContact and product tour requests rejected with undefined or a string, which Bugsnag and Sentry report as a non-error unhandled rejection with no message. They now reject with an Error that names the call and the reason (network error, HTTP status, refusal code). A logout while a request is on its way resolves instead of rejecting. A product tour that is not live on the page no longer logs console.error. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # CHANGELOG.md
…r, setStyles types) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- setLanguage catches the updateContact it makes itself, so a failed request never becomes an unhandled rejection the host app can't catch. - requestError marks the Error with gleapReason; setUserJwt logs that reason instead of a stale lastIdentifyFailure. - Product tours stay quiet for failed Gleap requests but still log real errors thrown by start(). - CHANGELOG: catch with Promise.resolve(...), since identify and updateContact return nothing when there is nothing to send. - Rebuilt 19.9.1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Problem
When
Gleap.identify,Gleap.updateContactor a product tour request fails (user offline, tab closing, ad blocker), the promise rejected withundefinedor'Session not ready yet.'. Apps that don't catch it get a Bugsnag/Sentry event "unhandledrejection handler received a non-error", with no message and no stack. A customer reported this.Fix
Errorthat names the call and the reason:Gleap updateContact failed: network error,Gleap identify failed: HTTP 500,Gleap identify failed: refused (token_invalid).network error, because browsers end a failed request with status 0 before the error event fires.console.error.setUserJwtwarning keeps its short reason.Unreleasedentry. No version bump.Tests
npx vitest run: 1053 passed.error()now ends with status 0 first, like a browser.🤖 Generated with Claude Code