hive-forge: comments --since --limit returns N, not at most 49
The issue-comments endpoint takes no page or limit, so `comments --since` cut its window client-side from a whole-list response. The leftover over-fetch-by-one request (`.page_size(limit + 1)`) was a no-op and the `--limit` clamp to MAX_LIMIT (49) guarded a truncation check that no longer needs one. Drop both: `--since T --limit N` now returns N comments. `comments --json` still emits `since_limit_clamped`, always `false`. `timeline` is untouched; its endpoint pages and its clamp stays.
This commit is contained in:
parent
1d56a74aad
commit
3d81266483
4 changed files with 54 additions and 50 deletions
|
|
@ -137,3 +137,23 @@ fn comments_tail_returns_the_last_n() {
|
|||
assert!(!stdout.contains(&format!("comment {}", THREAD_LEN - 4)));
|
||||
assert!(stdout.contains(&format!("({} earlier comment(s)", THREAD_LEN - 3)));
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn comments_since_limit_above_a_page_returns_exactly_limit() {
|
||||
let stdout = hive_forge(
|
||||
"since-limit",
|
||||
&[
|
||||
"--json",
|
||||
"comments",
|
||||
NUMBER,
|
||||
"--since",
|
||||
"2026-10-09T00:00:00Z",
|
||||
"--limit",
|
||||
"55",
|
||||
],
|
||||
);
|
||||
let out: serde_json::Value = serde_json::from_str(&stdout).expect("comments --json output");
|
||||
assert_eq!(out["comments"].as_array().map(Vec::len), Some(55));
|
||||
assert_eq!(out["since_more"], true);
|
||||
assert_eq!(out["since_limit_clamped"], false);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue