Skip to content

fix(axios-client): stop Activity Monitor sticking on "Pending" after a 200#201

Open
netanelgilad wants to merge 1 commit into
mainfrom
claude/eager-mendel-5dbx7z
Open

fix(axios-client): stop Activity Monitor sticking on "Pending" after a 200#201
netanelgilad wants to merge 1 commit into
mainfrom
claude/eager-mendel-5dbx7z

Conversation

@netanelgilad

Copy link
Copy Markdown
Collaborator

What

Mirror of the platform-side fix in apper (PR base44-dev/apper#12518). The host builder's Activity Monitor creates a "Pending" entry on api-request-start and resolves it on api-request-end. Both are sent to the parent window via postMessage, which serializes with the structured-clone algorithm.

When a request/response body isn't structured-cloneable (a function, stream, or other host object), postMessage throws DataCloneError synchronously:

  • success path — the throw was swallowed by an empty try/catch, so api-request-end was never delivered → the request stayed "Pending" forever despite returning 200.
  • error path — posted no api-request-end at all, so failed requests also stuck on "Pending".

Fix

Route all activity messages through postActivityMessage, which retries with a JSON-sanitized payload (toSerializable) when the raw post throws — the status code is always delivered, the real body is preserved when cloneable. Also emit api-request-end on the error path.

Tests

New tests/unit/axios-client.test.ts simulates the browser (postMessage runs structuredClone) and asserts the end event is still delivered for a non-cloneable 200, plus toSerializable coverage. The guard fails on the old swallow-only code and passes with the fix. Full unit suite (159) + typecheck green.

🤖 Generated with Claude Code

https://claude.ai/code/session_01TMZivSDxbkghHKnS1iyxvs

@claude

claude Bot commented Jun 21, 2026

Copy link
Copy Markdown

Claude encountered an error —— View job


I'll analyze this and get back to you.

@github-actions

github-actions Bot commented Jun 21, 2026

Copy link
Copy Markdown

🚀 Package Preview Available!


Install this PR's preview build with npm:

npm i @base44-preview/sdk@0.8.32-pr.201.f1de9af

Prefer not to change any import paths? Install using npm alias so your code still imports @base44/sdk:

npm i "@base44/sdk@npm:@base44-preview/sdk@0.8.32-pr.201.f1de9af"

Or add it to your package.json dependencies:

{
  "dependencies": {
    "@base44/sdk": "npm:@base44-preview/sdk@0.8.32-pr.201.f1de9af"
  }
}

Preview published to npm registry — try new features instantly!

…a 200

The Activity Monitor (host builder) creates a "Pending" entry on
api-request-start and resolves it on api-request-end. Both are sent to the
parent window via postMessage, which serializes with the structured-clone
algorithm. When a request/response body isn't structured-cloneable (e.g. a
backend function whose response carries a function, stream, or other host
object), postMessage throws DataCloneError synchronously. On the success
path that throw was swallowed by an empty try/catch, so api-request-end was
never delivered and the request stayed "Pending" forever despite returning
200. The error path posted nothing at all.

Route all activity messages through postActivityMessage, which retries with a
JSON-sanitized payload (toSerializable) when the raw post throws, so the
status code is always delivered while the real body is preserved when
cloneable. Also post api-request-end on the error path so failed requests
resolve too.

Mirrors the platform-side fix in apper (builder axiosClient).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TMZivSDxbkghHKnS1iyxvs
@netanelgilad netanelgilad force-pushed the claude/eager-mendel-5dbx7z branch from f1d7c0e to c3e12bc Compare June 21, 2026 10:30
@claude

claude Bot commented Jun 21, 2026

Copy link
Copy Markdown

Claude encountered an error —— View job


I'll analyze this and get back to you.

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