What's new
fix: unstick repos in 'mirroring' on transient errors (fixes #268)
Repositories could get permanently stuck in the mirroring state — with no failure entry in the activity log — when a transient error hit during the Gitea migrate call. The catch block referenced let migrateSucceeded that had been declared inside the same try block; block-scoping made it invisible from catch, so the catch crashed with ReferenceError: migrateSucceeded is not defined before it could update the DB to failed.
This release hoists the declaration above the try in both mirrorGithubRepoToGitea and mirrorGitHubRepoToGiteaOrg, restoring the intended behavior:
- transient errors (timeouts, 5xx, etc.) now correctly transition the repo to
failedinstead of leaving it stuck inmirroring mirroredLocationis cleared when the migrate call itself never succeeded- a failure entry is written to the activity log
- the original error message is preserved on retry (no more misleading
Failed to mirror repository: migrateSucceeded is not defined)
Upgrade note: anyone who saw repos pile up in mirroring after upgrading from older versions can retry those repos after this release — they will now move to failed and become retriable instead of getting stuck again.
A structural regression test in src/lib/gitea-mirror-failure-recovery.test.ts guards against re-introducing the scoping bug.
See full discussion in #268.