Import repair: Done card retried via an existing remote issue is linked but not closed on Forgejo #100
Loading…
Add table
Add a link
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?
How found: coordinator re-review of Breadway/breadboard PR98 at head
4e404eca(code reading; not reproduced against a live Forgejo).Confidence: medium-high (clear from the code paths; not covered by any test).
Explanation: in
writeback_new_issue_result, the remote closed state for a Done card is applied only on the fresh-create-then-link success path. Two early-return paths skip it: (a) whenforgejo::find_import_issuefinds the marker and links the existing issue, and (b) whenstore::link_issueerrors andfind_issue_by_forgejofinds the already-linked issue. A Done local card retried through either path links to an open remote issue, so local and remote state diverge and a reconcile pass may report drift. Reachable when an earlier create succeeded but the subsequent link failed for a card that is Done.Suggested fix: apply the same Done-close after a successful link in both early-return paths, for example by extracting a helper that links and then closes when the linked status is Done.
Also observed:
forgejo::find_import_issuelists only page 1 (limit 50) of/issues?state=all, so on a busy repository the marker lookup can miss a just-created issue that is not on the first page. Consider paging the lookup or a marker-targeted search.Refs PR98 (merged
2a538f089a), review 5442.