listFiles can loop forever when the server stops advancing
#7
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Client.listFiles(src/client.ts:175-199) paginates with awhile (hasMore)loop, raisingsinceTimeto the maximumupdationTimeit has seen. If the server returnshasMore: truetogether with an empty
diff, or with entries whoseupdationTimeis not greater than thecurrent
sinceTime, thensinceTimenever advances and the loop issues the identical requestforever. There is no iteration cap and no progress assertion.
For a backup tool this is the worst failure shape: it does not crash, it does not log, it just
hangs and hammers the API. There is also no test that exercises
hasMore: trueat all — everyexisting test returns a single page.
Definition of done
listFilescannot loop indefinitely. It terminates with a clear error when a page fails tomake progress (empty
diffwithhasMore: true, orsinceTimenot strictly increasing).pagination cursor, so the failure is diagnosable from a log line alone.
hasMoreis false.non-advancing server terminating with the new error rather than hanging; a single-page
enumeration behaving exactly as before.
requests made.
make checkgreen.TODO.mdupdated in the same commit.Out of scope
Retry, backoff and request timeouts — separate issue.