Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in process execution forces automatic scanning on status update #158

Open
projectgus opened this issue Oct 4, 2023 · 2 comments
Open
Assignees
Labels
bug Something isn't working
Milestone

Comments

@projectgus
Copy link
Contributor

projectgus commented Oct 4, 2023

This is a pretty minor bug that I noticed but thought was worth reporting.

Steps to reproduce

  • Customise magit-todos-update to either nil (manual updates) or a number of seconds to cache.
  • Run manual magit-todos-update to scan for TODOs.
  • An error occurs while running the process (for example, rg reports permission denied error for a file in the repo working directory).

Expected behaviour

Afterwards, refreshing magit status will continue to not automatically scan for to-dos (as per the magit-todos-update selection).

Observed behaviour

Afterwards, refreshing magit status will trigger a new scan each time, behaving as if magit-todos-update was set to t.

Analysis

  • Local variable magit-todos-updating is set to t before evaluating magit-todos--async-start-process. It is only set to nil again by the finish-func callback (and this only runs if the process succeeds.)
  • If there's an error then the magit-todos-updating stays t until/unless the scan process re-runs and succeeds. This causes the magit status callback to be treated as a manual update each time.
@alphapapa
Copy link
Owner

Hi Angus,

This might be the best-written bug report I've ever received. Should be a simple fix. Thank you!

@alphapapa alphapapa self-assigned this Oct 4, 2023
@alphapapa alphapapa added the bug Something isn't working label Oct 4, 2023
@alphapapa alphapapa added this to the 1.7.1 milestone Oct 4, 2023
@alphapapa alphapapa modified the milestones: 1.7.1, 1.8 Feb 13, 2024
@alphapapa
Copy link
Owner

Fixing this has the potential to cause other bugs, so targeting it for 1.8 so it can sit on master for a while.

@alphapapa alphapapa modified the milestones: 1.8, v1.9 Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants