refactor(fetch): share query building between daemon and direct paths - #53
Merged
Conversation
Follow-up to #52: the /v1/fetch query (url params + optional live=true) was built identically in the daemon handler and the direct-HTTP fallback; a future fetch param could silently drift between them. Extract DaemonRequest::fetch_query() as the single source. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
PR Summary by QodoRefactor fetch: centralize /v1/fetch query building in DaemonRequest
AI Description
Diagram
High-Level Assessment
Files changed (2)
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Cleanup follow-up to #52, from a 4-angle review (reuse / simplification / efficiency / altitude) of that diff.
/v1/fetchquery (url params + optionallive=true) was built identically in two places — the daemon's fetch handler and the direct-HTTP fallback inexecute()— so any future fetch param would need matched edits and could silently drift between the paths.DaemonRequest::fetch_query()(indaemon.rs, next to the struct both modules already share) as the single source; both call sites now use it. No behavior change.Considered and skipped: generalizing fetch params into an opaque passthrough (like search's
body) — YAGNI with exactly one fetch param today.Testing
cargo fmt/cargo clippy --all-targets -- -D warnings/cargo testclean.pytest tests/e2e/test_fetch.py— 8/8 pass against the rebuilt binary.fetch --livethrough a running daemon (isolatedKEENABLE_HOME).🤖 Generated with Claude Code