Skip to content

fix(logs): filter --level client-side when the backend ignores it#561

Open
yoavf wants to merge 1 commit into
mainfrom
fix/logs-client-level-filter
Open

fix(logs): filter --level client-side when the backend ignores it#561
yoavf wants to merge 1 commit into
mainfrom
fix/logs-client-level-filter

Conversation

@yoavf

@yoavf yoavf commented Jul 7, 2026

Copy link
Copy Markdown
Collaborator

Note

Description

The base44 logs --level <level> filter relied on the backend to honor the level query parameter, but not every runtime does — per-app Cloudflare deployments ignore it and return the full log stream. This PR adds a defensive client-side filter so --level is always respected regardless of backend behavior, using the schema-normalized entry levels for the comparison.

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

  • In fetchLogsForFunctions, filter fetched log entries by filters.level client-side before normalizing/appending them, so results match the requested level even when the backend ignores the query param.
  • Rely on the response schema normalization (e.g. wire value warnwarning) so the comparison stays correct.
  • Added tests covering: dropping other levels when the backend returns the full stream, and keeping normalized warnwarning entries when filtering by --level warning.

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

The filter is intentionally defensive: when the backend does correctly filter by level, this is a no-op; when it does not, the CLI now enforces the requested level. Level comparison uses the already-normalized values from the response schema.


🤖 Generated by Claude | 2026-07-07 08:18 UTC | 234c4ed

Per-app Cloudflare deployments return the full app log stream and drop
the level query param, so --level silently showed every level. Filter
the returned entries client-side against the requested level; entry
levels are already normalized by the response schema, so warn entries
match --level warning.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

🚀 Package Preview Available!


Install this PR's preview build with npm:

npm i @base44-preview/cli@0.1.2-pr.561.234c4ed

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.2-pr.561.234c4ed"

Or add it to your package.json dependencies:

{
  "dependencies": {
    "base44": "npm:@base44-preview/cli@0.1.2-pr.561.234c4ed"
  }
}

Preview published to npm registry — try new features instantly!

@yoavf yoavf marked this pull request as ready for review July 7, 2026 08:19
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