Fix duplicate-after-sync regression for newly created backlog items #212

Closed
opened 2026-06-01 22:52:20 +00:00 by steve · 0 comments
Owner

Describe the issue.

Problem

pnpm backlog:sync can leave a newly created temp issue stranded after the
remote Forgejo issue is already created. The next sync run then fails with a
remote duplicate error instead of adopting the already-created remote issue.

This currently blocks all later sync work when any stale temp issue remains.

Goal

Make backlog push or sync recover temp issues whose remote Forgejo issue already
exists from a prior partial sync, then continue syncing normally.

Scope

  • Reproduce the temp-local plus remote-numbered mismatch.
  • Fix the issue-sync push path so it can adopt the remote issue instead of
    hard-failing on the next run.
  • Cover the recovery path with regression tests.
  • Update backlog workflow documentation if behavior changes.

Non-goals

  • Broader backlog workflow redesign.
  • Changing normal duplicate handling for unrelated title or task_id conflicts.

Acceptance Criteria

  • A temp local issue whose remote counterpart still carries the same temp marker
    is recovered into a numbered local issue during pnpm backlog:sync.
  • The recovery path does not silently adopt unrelated pre-existing remote issues
    that only share a title.
  • Script regression tests cover the recovery behavior.
  • The backlog docs describe the recovery behavior when relevant.

Implementation Notes

  • Start from the push path that currently calls assertNoRemoteDuplicate(...)
    for temp issues.
  • Verify whether the remote issue body still carries the original
    `

` marker after partial failure and use that marker
as the recovery discriminator.

Suggested Files or Specs To Inspect

  • scripts/issue-sync.mjs
  • scripts/issue-sync-lib.mjs
  • scripts/issue-sync-lib.test.mjs
  • spec/src/80-maintenance/issues-backlog.md

Validation Commands

  • node --test scripts/issue-sync-lib.test.mjs scripts/issue-sync-progress.test.mjs
  • pnpm backlog:sync
  • pnpm backlog:doctor --strict

Follow-up Tasks

Implementation Summary

Recovered temp issues whose remote Forgejo twin already exists, fixed stale mirror cleanup after remote create, added marker-based regression coverage, and documented the recovery behavior.

Describe the issue. ## Problem `pnpm backlog:sync` can leave a newly created temp issue stranded after the remote Forgejo issue is already created. The next sync run then fails with a remote duplicate error instead of adopting the already-created remote issue. This currently blocks all later sync work when any stale temp issue remains. ## Goal Make backlog push or sync recover temp issues whose remote Forgejo issue already exists from a prior partial sync, then continue syncing normally. ## Scope - Reproduce the temp-local plus remote-numbered mismatch. - Fix the issue-sync push path so it can adopt the remote issue instead of hard-failing on the next run. - Cover the recovery path with regression tests. - Update backlog workflow documentation if behavior changes. ## Non-goals - Broader backlog workflow redesign. - Changing normal duplicate handling for unrelated title or task_id conflicts. ## Acceptance Criteria - A temp local issue whose remote counterpart still carries the same temp marker is recovered into a numbered local issue during `pnpm backlog:sync`. - The recovery path does not silently adopt unrelated pre-existing remote issues that only share a title. - Script regression tests cover the recovery behavior. - The backlog docs describe the recovery behavior when relevant. ## Implementation Notes - Start from the push path that currently calls `assertNoRemoteDuplicate(...)` for temp issues. - Verify whether the remote issue body still carries the original ` <!-- backlog:task_id=TASK-BACKLOG-SYNC-DUPLICATE-AFTER-CREATE source_spec=spec/src/80-maintenance/issues-backlog.md related_issue=182 --> ` marker after partial failure and use that marker as the recovery discriminator. ## Suggested Files or Specs To Inspect - `scripts/issue-sync.mjs` - `scripts/issue-sync-lib.mjs` - `scripts/issue-sync-lib.test.mjs` - `spec/src/80-maintenance/issues-backlog.md` ## Validation Commands - `node --test scripts/issue-sync-lib.test.mjs scripts/issue-sync-progress.test.mjs` - `pnpm backlog:sync` - `pnpm backlog:doctor --strict` ## Related Issues - Follow-up to #182 — [Fix backlog helper argument parsing and duplicate mirror diagnostics](../closed/182-fix-backlog-helper-argument-parsing-and-duplicate-mirror-diagnostics.md) ## Follow-up Tasks ## Implementation Summary Recovered temp issues whose remote Forgejo twin already exists, fixed stale mirror cleanup after remote create, added marker-based regression coverage, and documented the recovery behavior.
steve added this to the Full Registry V1 milestone 2026-06-01 22:52:20 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lapis-notes/lapis#212
No description provided.