Skip to content

sync push --branch: two dev-only reference edge cases after a promote #928

Open

Description

@padak

Problem

After the promote fix (sync push --branch DEV from main/), two edge cases can still leave a reference on the dev branch pointing at a config or row that no longer exists there. Both affect only the dev branch; production data is not touched.

GPT Astra found both during the final review of the promote fix, and both were reproduced with in-memory calls.

  1. A promoted row deleted on both sides still resolves through its saved mapping.
    • Steps: promote P/r1, which creates D/d1 on DEV. Remove the local r1 row folder and delete d1 on DEV. Edit a flow to select P/["r1"] and push --branch DEV.
    • Neither side contains the row, so the row changeset is empty and note_gone() never sees the deletion.
    • Result: the DEV flow gets D/["d1"], and no pending marker is kept.
    • Location: services/_sync_promote_remap.py (the _unit / note_gone path).
    • Fix idea: validate saved mappings against the target inventory, including tracked targets that are absent from both sides of the diff.
  2. A deleted identity-mapped parent loses its pending marker when the task selects no rows.
    • Steps: the dev branch held config P under the production id and P was later deleted on DEV. A pending flow task runs P without configRowIds.
    • The rewrite is correctly blocked, but open_refs() returns nothing, so recovery clears rebind_pending.
    • Location: services/_sync_promote_remap.py (open_refs).
    • Fix idea: pending detection should account for known-deleted parents, also for identity mappings without row selections.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions