Housekeeping: a null page is an empty one (#182)
ci / test (push) Successful in 37s
sync / sync (push) Successful in 4s

Housekeeping: a null page is an empty one (#182)

Gitea answers an issue nobody reacted to with null; the signal step failed on it today.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017K4vyY3yUD3GsvoZaAtKkD
This commit was merged in pull request #182.
This commit is contained in:
teahubxyzandClaude Opus 5.5 committed 2026-10-19 13:47:24 +00:00
1 parent 805e20d695
commit d235afb7f3
3 files changed
+5 -3

No files matched your search

+1 -1
View File
@@ -46,7 +46,7 @@ def paged(path: str, pages: int = 40) -> list[dict]:
sep = "&" if "?" in path else "?"
out: list[dict] = []
for page in range(1, pages + 1):
batch = tm.gh("GET", f"{path}{sep}limit=50&page={page}")
batch = tm.gh("GET", f"{path}{sep}limit=50&page={page}") or [] # Gitea answers an issue with no reactions with null
out += batch
if len(batch) < 50:
break
+3 -2
View File
@@ -64,8 +64,9 @@ class Forge:
if m["id"] == int(route.split("/")[-1]):
m.update(body)
return {}
if route.endswith("/reactions"):
return self.page(self.reactions.get(int(route.split("/")[-2]), []), path)
if route.endswith("/reactions"): # Gitea: null, not [], for an issue nobody reacted to
n = int(route.split("/")[-2])
return self.page(self.reactions[n], path) if n in self.reactions else None
if route.endswith("/comments") and method == "GET":
return self.page(self.cmts.get(int(route.split("/")[-2]), []), path)
if route.endswith("/comments") and method == "POST":