Skip to content

[bug] A reports write that finds its content already committed leaves an unpushed commit behind #1277

Closed

Description

@SaulMoro

What happens

updateReports runs a write callback under the reports lock, commits the files it names, and pushes. A callback that returns null makes the update answer already-present without pushing. When an earlier attempt committed the same content and its push failed, that commit stays in the local reports checkout. It reaches origin only with the next write that names files.

Several writers return null when their content is already in the checkout, so a retry after a failed push reports success and leaves the commit unpushed:

  • bootstrap.ts (~302): member registration returns null when members/<user>.yaml exists.
  • init.ts (~1455, ~2017): the same check during init.
  • hook-handlers.ts (~618, ~828): votes sync returns null when nothing new is staged.
  • team-push.ts (~1115): the auto-report write returns null when it wrote no files, so its pushIfUnchanged: true option never takes effect.

session save --push had the same problem. The #1084 work fixed it by always naming the summary file, and made an empty files: [] write go through the unpushed-commit check in commitAndPushAt.

Expected

A writer whose content is already committed but not on origin pushes that commit, and reports published once origin has it.

Suggested fix

Return { files: [], message } instead of null from those callbacks when the content is already there. An empty write now pushes a commit an earlier attempt left. Keep null for callbacks that only read under the lock (session pull, the run snapshot reads), which must never push.

Activity

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

    bugSomething isn't workinghelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions