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

Branched todos section may appear multiple times when reloading too quickly #145

Open
ghost opened this issue Mar 26, 2023 · 3 comments · May be fixed by #168
Open

Branched todos section may appear multiple times when reloading too quickly #145

ghost opened this issue Mar 26, 2023 · 3 comments · May be fixed by #168
Assignees
Labels
bug Something isn't working
Milestone

Comments

@ghost
Copy link

ghost commented Mar 26, 2023

Hello,

When reloading the buffer while the main TODOs list has not been populated yet, the branched section will appear multiple times.

To reproduce on this repo, branch out of master, add a todo anywhere in the code, run magit-status then hold G for a couple of seconds.

This is what happens :
image

I have not yet been able to identify why this happens, maybe it is a known issue.

@alphapapa
Copy link
Owner

Hi Matthias,

Thanks for reporting this. I've seen it occasionally myself.

It appears to simply be a matter of my not implementing a check for multiple such scans happening in this code:

(when (or (eq magit-todos-branch-list t)

Whereas the main scanners have such a check:

magit-todos/magit-todos.el

Lines 725 to 732 in 7724259

(when magit-todos-active-scan
;; Avoid running multiple scans for a single magit-status buffer.
(let ((buffer (process-buffer magit-todos-active-scan)))
(when (process-live-p magit-todos-active-scan)
(delete-process magit-todos-active-scan))
(when (buffer-live-p buffer)
(kill-buffer buffer)))
(setq magit-todos-active-scan nil))

@alphapapa alphapapa self-assigned this Mar 26, 2023
@alphapapa alphapapa added the bug Something isn't working label Mar 26, 2023
@alphapapa alphapapa added this to the 1.6.1 milestone Mar 26, 2023
@ghost
Copy link
Author

ghost commented Mar 31, 2023

Should the check be implemented in magit-todos--insert-todos or in the macro defined function?

@alphapapa
Copy link
Owner

Probably here:

(when (or (eq magit-todos-branch-list t)

@alphapapa alphapapa modified the milestones: 1.6.1, 1.8 Aug 26, 2023
@mpaulmier mpaulmier linked a pull request Jan 24, 2024 that will close this issue
@alphapapa alphapapa modified the milestones: 1.8, v1.9 Sep 9, 2024
alphapapa pushed a commit to mpaulmier/magit-todos that referenced this issue Sep 27, 2024
This is to prevent the scan to be run multiple times and show more than once in
Magit's buffer

Fixes alphapapa#145 && alphapapa#127

Modified-by: Adam Porter <[email protected]>
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

Successfully merging a pull request may close this issue.

1 participant