Skip to content

Commit 9c0cb49

Browse files
LucaB01claude
andcommitted
fix: setLanguage catches its contact update; review fixes for 19.9.1
- 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>
1 parent 2f8e8a0 commit 9c0cb49

15 files changed

Lines changed: 31 additions & 21 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Changelog
22

33
## 19.9.1
4-
Changed: when `Gleap.identify` or `Gleap.updateContact` fails, the promise it returns rejects with an `Error`, for example `Gleap updateContact failed: network error`, `Gleap identify failed: HTTP 500` or `Gleap identify failed: refused (token_invalid)`. Until this version it rejected with `undefined` or the string `'Session not ready yet.'`, which error trackers such as Bugsnag and Sentry report as a non-error unhandled rejection with no message. A logout while one of these requests was still on its way now resolves instead of rejecting. Add a `.catch()` to these calls if your app does not want failed requests (for example a user who is offline) in its error tracker.
4+
Changed: when `Gleap.identify` or `Gleap.updateContact` fails, the promise it returns rejects with an `Error`, for example `Gleap updateContact failed: network error`, `Gleap identify failed: HTTP 500` or `Gleap identify failed: refused (token_invalid)`. Until this version it rejected with `undefined` or the string `'Session not ready yet.'`, which error trackers such as Bugsnag and Sentry report as a non-error unhandled rejection with no message. A logout while one of these requests was still on its way now resolves instead of rejecting. If your app does not want failed requests (for example a user who is offline) in its error tracker, catch them with `Promise.resolve(Gleap.identify(...)).catch(() => {})`. Wrap the call in `Promise.resolve`, because these calls return nothing when there is nothing to send. `Gleap.setLanguage` catches its own contact update.
55
Changed: a product tour that is not live on the current page no longer writes to `console.error`.
66
Fixed: `index.d.ts` declared `Gleap.setStyles` with one object, but the SDK takes positional arguments: `setStyles(primaryColor, headerColor, buttonColor, backgroundColor?, borderRadius?, buttonX?, buttonY?, buttonStyle?, headerColor2?, headerColor3?)`. A call in the declared object form threw an error on the page and injected no styles. TypeScript projects that call `setStyles` with an object now get a compile error pointing at that call, which never worked; pass the values as arguments instead. No runtime change.
77

‎build/browser/index.js‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎build/browser/index.js.map‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎build/cjs/index.js‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎build/cjs/index.js.map‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎build/esm/index.mjs‎

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

‎build/esm/index.mjs.map‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎published/19.9.1/index.js‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎published/19.9.1/index.js.map‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎published/latest/index.js‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)