fix: intermittent stale push statusline after commit#36
Merged
martinabeleda merged 1 commit intomainfrom Mar 30, 2026
Merged
Conversation
…times after a successful commit, the push statusline could stay stalej and not reflect the new "to push" count immediately.jj Refactor refresh internals to support explicit non-debounced refreshes andj add a guarded second refresh after commit when the first refresh appearsj stale (unpushed count did not advance).jj Also extract post-commit refresh behavior into a testable helper and addj regression tests for:j - retry when first refresh is stalej - no retry when first refresh is already correctj
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This fixes an intermittent issue where, after committing, the statusline sometimes failed to update the ↑N commits to push indicator right away.
Root cause (observed behavior)
Immediately after git commit, the first snapshot refresh could occasionally return stale upstream/ahead state, causing the statusline to continue showing the previous
unpushed count.
What changed
- refresh_unpushed_after_commit_retries_when_first_refresh_is_stale
- refresh_unpushed_after_commit_does_not_retry_when_unpushed_advances
Why this is safe
Testing
cargo test -qAll tests pass.