fix: abort superseded issue suggestion requests (#38620)

Fix regression from https://github.com/go-gitea/gitea/pull/38610

`perfect-debounce` allowed only one request in flight; `debounce` does
not, so a slow older request can resolve after a newer one and leave a
stale suggestion menu. Superseded requests are now aborted.
This commit is contained in:
silverwind
2026-07-24 21:25:38 +02:00
committed by GitHub
parent 9ad80e1eba
commit 37e80730ec
2 changed files with 17 additions and 8 deletions
+2 -2
View File
@@ -71,8 +71,8 @@ export async function matchMention(mentionsUrl: string, queryText: string): Prom
return sortAndReduce(results);
}
export async function matchIssue(owner: string, repo: string, issueIndexStr: string, query: string): Promise<Issue[]> {
const res = await GET(`${window.config.appSubUrl}/${owner}/${repo}/issues/suggestions?q=${encodeURIComponent(query)}`);
export async function matchIssue(owner: string, repo: string, issueIndexStr: string, query: string, signal: AbortSignal): Promise<Issue[]> {
const res = await GET(`${window.config.appSubUrl}/${owner}/${repo}/issues/suggestions?q=${encodeURIComponent(query)}`, {signal});
const issues: Issue[] = await res.json();
const issueNumber = parseInt(issueIndexStr);