Skip to content

fix(KNO-14505): handle guide engagement API failures - #1053

Merged
thomaswhyyou merged 3 commits into
mainfrom
kyle-kno-14505-sdk-prevent-guide-engagement-api-failures-from-becoming
Aug 3, 2026
Merged

fix(KNO-14505): handle guide engagement API failures#1053
thomaswhyyou merged 3 commits into
mainfrom
kyle-kno-14505-sdk-prevent-guide-engagement-api-failures-from-becoming

Conversation

@kylemcd

@kylemcd kylemcd commented Jul 29, 2026

Copy link
Copy Markdown
Member

Description

  • The guide client started engagement requests without rejection handlers. API failures then caused global unhandled promise rejections.
  • Each guide action now catches and logs its engagement request failures.
  • Guide actions still update local state before the requests complete.
  • UserClient now throws the original API error with its HTTP status and response data.

Release

  • The changeset adds patch releases for @knocklabs/client and @knocklabs/react.
  • Linear: KNO-14505.

Validation

  • The client test suite passed 631 tests.
  • The client type check passed.
  • The client lint check passed.
  • The changeset check passed.

Checklist

  • Tests cover the new guide engagement behavior and API error details.

@linear-code

linear-code Bot commented Jul 29, 2026

Copy link
Copy Markdown

KNO-14505

@vercel

vercel Bot commented Jul 29, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
javascript-ms-teams-connect-example Ready Ready Preview Aug 3, 2026 9:41pm
javascript-nextjs-example Ready Ready Preview Aug 3, 2026 9:41pm
javascript-slack-connect-example Ready Ready Preview Aug 3, 2026 9:41pm
javascript-slack-kit-example Ready Ready Preview Aug 3, 2026 9:41pm

Request Review

@changeset-bot

changeset-bot Bot commented Jul 29, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 5ec9623

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 6 packages
Name Type
@knocklabs/client Patch
@knocklabs/react Patch
ms-teams-connect-example Patch
nextjs-app-dir-example Patch
slack-connect-example Patch
slack-kit-example Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@codecov

codecov Bot commented Jul 29, 2026

Copy link
Copy Markdown

Bundle Report

Changes will increase total bundle size by 845 bytes (0.14%) ⬆️. This is within the configured threshold ✅

Detailed changes
Bundle name Size Change
@knocklabs/client-client-esm 69.62kB 457 bytes (0.66%) ⬆️
@knocklabs/client-client-cjs 58.29kB 388 bytes (0.67%) ⬆️

Affected Assets, Files, and Routes:

view changes for bundle: @knocklabs/client-client-esm

Assets Changed:

Asset Name Size Change Total Size Change (%)
clients/guide/client.mjs 457 bytes 21.42kB 2.18%

Files in clients/guide/client.mjs:

  • ./src/clients/guide/client.ts → Total Size: 26.47kB
view changes for bundle: @knocklabs/client-client-cjs

Assets Changed:

Asset Name Size Change Total Size Change (%)
clients/guide/client.js 388 bytes 17.79kB 2.23%

Files in clients/guide/client.js:

  • ./src/clients/guide/client.ts → Total Size: 26.83kB

kylemcd and others added 3 commits August 3, 2026 17:36
Revert the UserClient.handleResponse change and its test. The guide
engagement catch handlers only log error.message, and the underlying
ApiRequestError already stringifies with its HTTP status, so preserving
the original error object bought nothing at the call site.

Dropping it also avoids incidentally changing the thrown error shape for
the other UserClient methods (identify, setPreferences, getChannelData,
and friends), keeping this patch limited to the unhandled rejection.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@codecov

codecov Bot commented Aug 3, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 73.06%. Comparing base (9dddaf7) to head (5ec9623).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1053      +/-   ##
==========================================
+ Coverage   73.00%   73.06%   +0.05%     
==========================================
  Files         139      139              
  Lines        4342     4351       +9     
  Branches     1275     1278       +3     
==========================================
+ Hits         3170     3179       +9     
  Misses       1055     1055              
  Partials      117      117              
Files with missing lines Coverage Δ
packages/client/src/clients/guide/client.ts 93.83% <100.00%> (+0.09%) ⬆️

@thomaswhyyou
thomaswhyyou merged commit 9b5f244 into main Aug 3, 2026
12 checks passed
@thomaswhyyou
thomaswhyyou deleted the kyle-kno-14505-sdk-prevent-guide-engagement-api-failures-from-becoming branch August 3, 2026 21:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants