Skip to content

fix(logs): avoid loading local project resources - #607

Merged
davidsu merged 4 commits into
mainfrom
fix/logs-skip-local-project-scan
Aug 27, 2026
Merged

fix(logs): avoid loading local project resources#607
davidsu merged 4 commits into
mainfrom
fix/logs-skip-local-project-scan

Conversation

@davidsu

@davidsu davidsu commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Note

Description

base44 logs used to read the local project config to figure out which functions to fetch logs for. That meant an unrelated local config error (e.g. an invalid entity file) could break a purely remote, read-only command, and the "function not found" hint listed local functions rather than what is actually deployed. This PR makes the command source function names exclusively from the deployed-functions API, and only when it actually needs them.

It also hardens the 404 path: the available-functions hint is now looked up lazily, and if that lookup fails the original logs error is rethrown instead of being masked by a secondary failure. When the hint does succeed, the 404 is attached as the cause of the resulting InvalidInputError.

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

  • Dropped readProjectConfig / getProjectFunctionNames from logs.ts — the command no longer loads local project resources, so a broken local config cannot fail a remote log fetch.
  • Function names are now resolved only from listDeployedFunctions(), and only when --function is omitted; with --function specified no list call is made at all.
  • Added getFunctionNamesForHint(): on a 404 it lazily fetches deployed function names for the hint, and rethrows the original logs error if that fetch fails, so a secondary error never masks the real one.
  • The InvalidInputError for a missing function now carries the 404 ApiError as its cause, and the hint text reads "Available functions in this app" instead of "in this project".
  • Unified the empty-state message to "No functions found in this app." (no more local/remote split).
  • Updated the --function help text to say logs are fetched for "all deployed functions" when the flag is omitted.
  • Tests: added coverage for skipping local resources with --function, listing deployed names in the 404 hint, and preserving the original error when the hint lookup fails; reworked existing tests to mock the functions list and removed now-unnecessary mocks.

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 docs/ (AGENTS.md) if I made architectural changes

Additional Notes

Behavior change worth noting: inside a local project, base44 logs with no --function now lists logs for functions deployed to the app rather than functions declared locally. Functions that exist locally but have never been deployed will no longer appear — which matches what the logs API can actually return.

The test suite was not executed in this environment (running it needs bun run build first), so the "tested locally"/"all tests pass" boxes are left unchecked pending CI.


🤖 Generated by Claude | 2026-08-27 10:26 UTC | 4743740

@github-actions

github-actions Bot commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

🚀 Package Preview Available!


Install this PR's preview build with npm:

npm i @base44-preview/cli@0.1.10-pr.607.4743740

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.1.10-pr.607.4743740"

Or add it to your package.json dependencies:

{
  "dependencies": {
    "base44": "npm:@base44-preview/cli@0.1.10-pr.607.4743740"
  }
}

Preview published to npm registry — try new features instantly!

talge-a11y
talge-a11y previously approved these changes Aug 27, 2026

@talge-a11y talge-a11y left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see my note

Comment thread packages/cli/src/cli/commands/project/logs.ts
davidsu added a commit that referenced this pull request Aug 27, 2026
bun 1.4.0 has no @oven/bun-darwin-aarch64 (or any other target package)
published on npm, so `bun build --compile --target=...` fails to download
the target executable and every `build` job on main goes red.

Pin the two jobs that cross-compile — test.yml's build job and
manual-publish.yml — to 1.3.14, the last version with all five target
packages on npm. Other workflows stay on latest; they never cross-compile.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
@davidsu
davidsu force-pushed the fix/logs-skip-local-project-scan branch from 98c69ef to aa4d559 Compare August 27, 2026 10:26
@davidsu
davidsu merged commit b219e26 into main Aug 27, 2026
14 checks passed
@davidsu
davidsu deleted the fix/logs-skip-local-project-scan branch August 27, 2026 10:33
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