Skip to content

Fix github push pre-filter race: non-id pushes skip locally-completed items #1842

Description

@SorraTheOrc

Summary:
Non-id wl github push runs can skip locally-completed work items when the repo last-push timestamp or pre-filter logic causes them to be excluded, while --id pushes succeed. This creates a user-visible bug where closing a work item locally does not close the linked GitHub issue unless pushed with --id.

Investigation shows the pre-filter uses a last-push timestamp plus updatedAt comparisons and can miss items in race conditions. We need to serialize push runs and improve pre-filter rules.

Proposed fix:

  1. Acquire a per-repo file lock for the duration of wl github push to prevent concurrent pushes from racing and advancing last-push mid-run.
  2. Improve the pre-filter: treat items with local changes (local updatedAt > githubIssueUpdatedAt) as candidates even if last-push suggests otherwise.
  3. Ensure --id always resolves the item from the full DB (bypass pre-filter) but unify final candidate set as union(filteredItems, explicit id, locally modified items).
  4. Add a deterministic integration test that reproduces the race and verifies behavior with and without locking.

Acceptance criteria:

  • Integration test reproduces the reported failure and passes after the fix.
  • wl github push (without --id) closes a GitHub issue for a work item that was marked completed locally with updatedAt > last-push timestamp.
  • All tests and build pass locally before changes are merged.

Related: WL-0MM8SU2R20PTDQ9I (example used during repro).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions