Skip to content

fix(mac): respect get_logs payload limit instead of hardcoding 50#49

Open
Relevant47 wants to merge 1 commit into
mainfrom
fix/issue-48-mac-get-logs-limit
Open

fix(mac): respect get_logs payload limit instead of hardcoding 50#49
Relevant47 wants to merge 1 commit into
mainfrom
fix/issue-48-mac-get-logs-limit

Conversation

@Relevant47
Copy link
Copy Markdown
Owner

Summary

The macOS handleGetLogs had a misleading // Extract limit from payload if present comment but the next line hardcoded let limit = 50 and threw away req. The Windows daemon already reads the payload's limit. This brings the platforms back in line with shared/protocol.ts's get_logs shape.

Files changed

  • daemon-mac/Sources/FocusLockDaemon/IpcSocketService.swift — read limit from req.payload using the same [String: AnyCodable] pattern that handleGetParentAudit already uses one function below (line 413).

Fixes #48

Risk tier

Trivial / single-file → normal PR, ready for review.

  • Mechanical change in a single read-only IPC handler.
  • Matches an existing pattern already in the same file (handleGetParentAudit).
  • Behavior on the default path is unchanged: if the UI omits limit (or sends a non-int), limit stays at 50, matching today's behavior.
  • The only observable difference is when a caller passes { limit: N } — Windows returns N rows; macOS now does too.

Verification

  • Cannot build Swift in this environment; CI's swift build -c release is the real gate.
  • Side-by-side compare with Windows IpcPipeService.cs:304-311 confirms equivalent semantics.

🤖 Generated with Claude Code


Generated by Claude Code

The macOS IPC handler had a comment claiming it would extract `limit`
from the payload, but the next line discarded `req` and hardcoded
`let limit = 50`. Mirror the Windows handler (and the pattern already
used by `handleGetParentAudit`) so callers requesting more or fewer
logs get what they asked for, restoring platform parity with
`shared/protocol.ts` and `IpcPipeService.cs`.

Fixes #48
@netlify
Copy link
Copy Markdown

netlify Bot commented Jun 1, 2026

Deploy Preview for focuslock-app ready!

Name Link
🔨 Latest commit f83bcd4
🔍 Latest deploy log https://app.netlify.com/projects/focuslock-app/deploys/6a1ce96250a5670008a459f3
😎 Deploy Preview https://deploy-preview-49--focuslock-app.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@vercel
Copy link
Copy Markdown

vercel Bot commented Jun 1, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
focus-lock Ready Ready Preview, Comment Jun 1, 2026 2:07am

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.

macOS daemon: get_logs ignores payload limit, always returns 50 entries

2 participants