Component: crates/sources (resolver.rs) | Severity: Low-Medium | Status: Code-traced
The GitLab tree pagination loop treats a 4xx (get_json → Ok(None)) as end-of-listing and returns Ok(vec![]). A typo'd path on a valid project (modern GitLab answers 404) then surfaces as "directory my-group/proj/skills/relese contains no files" - claiming the directory exists but is empty. The GitHub equivalent surfaces an explicit listing failure. v1.7.2 claims this class was fixed for both forges.
Where: crates/sources/src/resolver.rs:377-379, :410-412; message from crates/sources/src/sync.rs:742-745; GitHub contrast resolver.rs:787-792.
Repro (unit): mock client returning Ok(None) (404) for the first tree page → listing returns empty → sync error text says "contains no files".
Expected: distinguish "listing request failed / path invalid" from "genuinely empty" (error on 404-page-one).
Actual: misleading empty-dir error.
Fix sketch: on page 1 a Missing response → return Err("failed to list directory … (404 - check the path)"); only later pages' end conditions terminate pagination.
Tests: unit in resolver.rs (mock): 404 first page → Err mentioning the path; empty-200 first page → Ok(empty) keeps the current message.
Component:
crates/sources(resolver.rs) | Severity: Low-Medium | Status: Code-tracedThe GitLab tree pagination loop treats a 4xx (
get_json→Ok(None)) as end-of-listing and returnsOk(vec![]). A typo'd path on a valid project (modern GitLab answers 404) then surfaces as "directory my-group/proj/skills/relese contains no files" - claiming the directory exists but is empty. The GitHub equivalent surfaces an explicit listing failure. v1.7.2 claims this class was fixed for both forges.Where:
crates/sources/src/resolver.rs:377-379,:410-412; message fromcrates/sources/src/sync.rs:742-745; GitHub contrastresolver.rs:787-792.Repro (unit): mock client returning
Ok(None)(404) for the first tree page → listing returns empty → sync error text says "contains no files".Expected: distinguish "listing request failed / path invalid" from "genuinely empty" (error on 404-page-one).
Actual: misleading empty-dir error.
Fix sketch: on page 1 a
Missingresponse → return Err("failed to list directory … (404 - check the path)"); only later pages' end conditions terminate pagination.Tests: unit in
resolver.rs(mock): 404 first page → Err mentioning the path; empty-200 first page → Ok(empty) keeps the current message.