Fix stale progress in --listen status payload (#4907)
CodeQL / Analyze (go) (push) Canceled after 0s
build / build (push) Canceled after 0s
Test fzf on macOS / build (push) Canceled after 0s

- progress was set to 100 by every UpdateList, partial results included,
  and never reset when a search started
- So a GET could report a new query, the previous result set, and
  progress 100, and a client had no way to tell it was stale
- Now cleared where the search is requested and set to 100 only on the
  final result. Query and the reset happen in the same locked section
  that dumpStatus locks, so query == X with progress 100 means the
  matches belong to X

Fix #4903
This commit is contained in:
Junegunn Choi authored and GitHub committed 2026-09-06 19:36:40 +09:00
1 parent 1372d04f79
commit 7e6339979f
3 files changed
+29 -1

No files matched your search

+4 -1
View File
@@ -2059,7 +2059,9 @@ func (t *Terminal) UpdateList(result MatchResult) {
prevIndex = t.targetIndex
t.targetIndex = minItem.Index()
}
t.progress = 100
if result.final() {
t.progress = 100
}
t.merger = merger
t.resultMerger = merger
t.passMerger = result.passMerger
@@ -8597,6 +8599,7 @@ func (t *Terminal) Loop() error {
reload := changed || newCommand != nil
if reload {
t.wait.searching = true
t.progress = 0
}
var reloadRequest *searchRequest
if reload {