Skip to content

fix: handle rejected action analytics - #1537

Open
SelormEssey wants to merge 1 commit into
coinbase:mainfrom
SelormEssey:fix/action-analytics-rejection
Open

SelormEssey wants to merge 1 commit into
coinbase:mainfrom
SelormEssey:fix/action-analytics-rejection

Conversation

@SelormEssey

Copy link
Copy Markdown

Description

Closes #1531.

@CreateAction invokes sendAnalyticsEvent() without awaiting it or attaching a rejection handler. If the analytics request fails, the detached Promise can produce an unhandled rejection and terminate the Node process during action invocation.

This change attaches a rejection handler at the action decorator call site while keeping analytics fire-and-forget. The wrapped action continues to execute immediately and its return behavior is unchanged.

This PR is intentionally scoped to the action invocation path. #1408 separately addresses the analogous wallet provider initialization path.

Tests

Added a focused regression test for the @CreateAction invocation path. The test mocks a rejected analytics request and verifies that:

  • the underlying action still executes
  • the expected action result is preserved
  • the analytics failure is logged as a warning
  • no unhandledRejection escapes

Validation completed successfully:

Focused Jest regression test: passed
TypeScript type check: passed
ESLint: passed
Prettier check: passed
Full Jest suite: 63 suites passed, 904 tests passed

A chatbot example was not run because this change is limited to error handling around the shared analytics call and does not change action inputs, outputs, wallet behavior, or chatbot behavior.

Checklist

  • Added documentation to all relevant README.md files (N/A, no documentation changes required)
  • Added a changelog entry

@cb-heimdall

Copy link
Copy Markdown

🟡 Heimdall Review Status

Requirement Status More Info
Reviews 🟡 0/2
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 1
Sum 2

@github-actions github-actions Bot added documentation Improvements or additions to documentation action provider New action provider typescript labels Oct 4, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

action provider New action provider documentation Improvements or additions to documentation typescript

Development

Successfully merging this pull request may close these issues.

[TypeScript] Failed analytics request terminates the process (unhandled rejection in action invocation and wallet provider init)

2 participants