Detail Bug Report
https://app.detail.dev/org_5f375fe3-a706-4e9a-a6f7-800f2439b3f6/bugs/bug_a24d4f9b-5acd-47dc-831f-62933c0a3cc8
Introduced in #319 by @tjdammann on Jul 24, 2026
Summary
- Context: The
format_fix_pr function in src/api/types.rs formats the Fix PR for display in the bugs show command.
- Bug: When the API returns an empty URL string, the function produces
#42 (merged) — with a dangling em-dash and trailing space.
- Actual vs. expected: Actual:
#42 (merged) — (looks like rendering failed). Expected: #42 (merged) (clean output matching the card view pattern).
- Impact: Users see output that appears broken, as if something failed to render. This is confusing and suggests the CLI might have a bug, rather than the data simply lacking a URL.
Code with Bug
pub fn format_fix_pr(fix_pr: &FixPr) -> String {
format!(
"#{} ({}) \u{2014} {}",
fix_pr.pr_number, fix_pr.state, fix_pr.url // <-- BUG 🔴 unconditionally includes URL
)
}
Explanation
FixPr.url can be an empty string (OpenAPI schema requires the field but does not enforce minLength). format_fix_pr always appends — {url}, so when url == "" the output ends with a dangling em-dash and trailing space.
Codebase Inconsistency
Elsewhere, the code omits the em-dash when there is no URL (format_linked_issue uses map_or_else to choose a no-URL format), and Bug.to_card() renders fix PRs as #42 (merged) without the URL. format_fix_pr should follow the same conditional formatting behavior.
Failing Test
fn format_fix_pr_with_empty_url() {
let fix_pr: FixPr = serde_json::from_value(serde_json::json!({
"prNumber": 42,
"url": "",
"state": "merged"
}))
.expect("valid FixPr JSON");
let result = format_fix_pr(&fix_pr);
assert_eq!(result, "#42 (merged) \u{2014} "); // <-- proves current output includes dangling em-dash
}
Recommended Fix
Handle empty URLs explicitly and omit the em-dash when fix_pr.url.is_empty():
pub fn format_fix_pr(fix_pr: &FixPr) -> String {
if fix_pr.url.is_empty() {
format!("#{} ({})", fix_pr.pr_number, fix_pr.state)
} else {
format!("#{} ({}) \u{2014} {}", fix_pr.pr_number, fix_pr.state, fix_pr.url)
}
}
History
This bug was introduced in commit 79486ad.
Detail Bug Report
https://app.detail.dev/org_5f375fe3-a706-4e9a-a6f7-800f2439b3f6/bugs/bug_a24d4f9b-5acd-47dc-831f-62933c0a3cc8
Introduced in #319 by @tjdammann on Jul 24, 2026
Summary
format_fix_prfunction insrc/api/types.rsformats the Fix PR for display in thebugs showcommand.#42 (merged) —with a dangling em-dash and trailing space.#42 (merged) —(looks like rendering failed). Expected:#42 (merged)(clean output matching the card view pattern).Code with Bug
Explanation
FixPr.urlcan be an empty string (OpenAPI schema requires the field but does not enforceminLength).format_fix_pralways appends— {url}, so whenurl == ""the output ends with a dangling em-dash and trailing space.Codebase Inconsistency
Elsewhere, the code omits the em-dash when there is no URL (
format_linked_issueusesmap_or_elseto choose a no-URL format), andBug.to_card()renders fix PRs as#42 (merged)without the URL.format_fix_prshould follow the same conditional formatting behavior.Failing Test
Recommended Fix
Handle empty URLs explicitly and omit the em-dash when
fix_pr.url.is_empty():History
This bug was introduced in commit 79486ad.