[client] _paginate: harden loop termination (missing totalPages) and duplicate page= param #181
Loading…
Reference in a new issue
No description provided.
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?
_paginate(_core.py:113-123) has two weaknesses:contentpage or thetotalPagescounter. If the server omitstotalPagesand keeps returning non-empty pages, the loop never ends.page=param: the separator logic ("&" if "?" in path else "?",_core.py:114) blindly appendspage={n}, so a path that already carriespage=yields two conflictingpageparams.Fix:
page=already present in the path (strip or fail loudly — never silently send both);totalPagescase (e.g. a max page count) that raisesComwattAPIErrorinstead of hanging.Done when: tests cover (a) a
page=already in the path, and (b) a server omittingtotalPagesthat keeps returning items — terminating via the bound instead of hanging.