Skip to content

fix: split README check into PR-comment + main-update jobs#241

Draft
Paveltarno wants to merge 4 commits intomainfrom
fix/readme-check
Draft

fix: split README check into PR-comment + main-update jobs#241
Paveltarno wants to merge 4 commits intomainfrom
fix/readme-check

Conversation

@Paveltarno
Copy link
Collaborator

@Paveltarno Paveltarno commented Feb 12, 2026

Note

Description

This PR fixes a critical bug in the token refresh mechanism where request bodies were being consumed during retry attempts, causing API calls to fail after 401 responses. The fix clones the request before retrying to preserve the original request body. Additionally, comprehensive test coverage has been added to verify the token refresh behavior works correctly for different API endpoints.

Related Issue

None

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Other (please describe):

Changes Made

  • Fixed token refresh mechanism in base44-client.ts by cloning requests before retry to prevent request body consumption
  • Added comprehensive authorization test suite (tests/cli/authorization.spec.ts) covering:
    • Token refresh on 401 for agents push with PUT requests
    • Token refresh on 401 for entities push with PUT requests
    • Failure handling when token refresh itself fails
  • Updated README.md with more accurate command descriptions and added missing commands (eject, connectors, types generate)

Testing

  • I have tested these changes locally
  • I have added/updated tests as needed
  • All tests pass (npm test)

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (if applicable)
  • My changes generate no new warnings
  • I have updated AGENTS.md if I made architectural changes

Additional Notes

The bug occurred because ky internally preserves the original request for retries, but when we passed the request to a nested ky() call without cloning, the nested call would consume the request body (via new Request(request, init)). This left the outer ky's preserved request in an unusable state if the inner call failed and outer ky attempted its own retry. Cloning the request ensures each layer maintains its own independent copy.


🤖 Generated by Claude | 2026-02-16 12:15 UTC

@github-actions
Copy link
Contributor

github-actions bot commented Feb 12, 2026

🚀 Package Preview Available!


Install this PR's preview build with npm:

npm i @base44-preview/cli@0.0.32-pr.241.887699f

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

npm i "base44@npm:@base44-preview/cli@0.0.32-pr.241.887699f"

Or add it to your package.json dependencies:

{
  "dependencies": {
    "base44": "npm:@base44-preview/cli@0.0.32-pr.241.887699f"
  }
}

Preview published to npm registry — try new features instantly!

@Paveltarno Paveltarno marked this pull request as draft February 12, 2026 12:21
@claude claude bot force-pushed the fix/readme-check branch from a0dc09b to f9f3953 Compare February 16, 2026 12:14
@claude
Copy link

claude bot commented Feb 16, 2026

README check ran. README is up to date.

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

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

2 participants

Comments