richardcase / richardcase/clowder
Bound JSON control-frame sizes across daemon and app
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 0
- Forks
- 0
- Avg merge
- 1h 14m
- Merged PRs (30d)
- 16
Description
Problem
The daemon uses unbounded JSON-lines input and the Swift LineBuffer retains an unlimited partial line.
Evidence: https://github.com/richardcase/clowder/blob/b5492d5/crates/clowder-daemon/src/control_json.rs#L40-L56
Swift buffer: https://github.com/richardcase/clowder/blob/b5492d5/macos/Sources/ClowderCore/LineBuffer.swift#L7-L20
Impact
A peer that never sends a newline can grow process memory indefinitely.
Acceptance criteria
- Define one protocol maximum for control lines.
- Enforce it in both implementations and close/report oversized frames.
- Add chunked over-limit tests.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with crates/clowder-daemon/src/control_json.rs and macos/Sources/ClowderCore/LineBuffer.swift, following the linked sections that parse and retain control lines. Trace how oversized frames are currently handled in each implementation, then add chunked over-limit tests for both sides. Done means one shared protocol maximum is enforced, with oversized frames reported or closed without unbounded buffering.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust, swift
- Domain
- cli, desktop, devtools
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 68/100