Skip to content

fix: respect console log line limit - #40

Open
Hushlor wants to merge 1 commit into
hypothesi:mainfrom
Hushlor:fix/console-log-lines
Open

fix: respect console log line limit#40
Hushlor wants to merge 1 commit into
hypothesi:mainfrom
Hushlor:fix/console-log-lines

Conversation

@Hushlor

@Hushlor Hushlor commented Jul 22, 2026

Copy link
Copy Markdown

Bug

read_logs exposed a lines parameter, but the source: "console" branch dropped it when readLogs called getConsoleLogs. The console retrieval script therefore applied since and filter, then formatted every matching entry without enforcing a line limit.

In the real test app, five uniquely tagged console messages queried with lines: 2 returned all five instead of the newest two. Android, iOS, and system-log paths use separate retrieval logic and were not affected.

Summary

  • pass read_logs.lines through the complete console-log retrieval chain
  • validate the limit as a positive integer while preserving the default of 50
  • apply since and filter before retaining the newest matching entries in chronological order

Regression coverage

  • reproduces five uniquely tagged console messages returning all five for lines: 2 before the fix
  • verifies the fixed result contains exactly messages 4 and 5
  • covers the 50-line default, custom limits, filter-before-limit, since-before-limit, chronological order, invalid limits, and existing regex filtering

Validation

  • npm run build (using Git Bash as npm's script shell on Windows)
  • npm run test:unit --workspace=@hypothesi/tauri-mcp-server — 64 passed
  • npm run test:e2e --workspace=@hypothesi/tauri-mcp-server — 157 passed, 1 skipped
  • npm run standards

The console and Rust IPC buffer sizes remain intentionally out of scope.

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.

1 participant