From bfe8bcafb833919b9907f2bbccb30c788181d821 Mon Sep 17 00:00:00 2001 From: yetone Date: Tue, 6 Oct 2026 03:48:04 +0800 Subject: [PATCH] provider: ForgetAccounts also forgets which accounts were asked for their model lists a moment ago, so accounts read afresh are asked again newFetches throttles FetchNew per account id for a minute. ForgetAccounts cleared the accounts but not that throttle, so an account read afresh under an id asked a moment before (another test's, or one signed in again) wasn't asked and the page wasn't told its lists were on their way. TestProvidersAnswerWhileListsComeIn depended on test order because of it ("not told the lists are on their way" when run after others). It fails on origin/main in the full package run and passes -race -count=5 with the change; go test -tags nogui ./... passes. --- internal/provider/logins.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/provider/logins.go b/internal/provider/logins.go index e9f95d64..cff2bf90 100644 --- a/internal/provider/logins.go +++ b/internal/provider/logins.go @@ -1138,6 +1138,11 @@ func ForgetAccounts() { loginsMu.Lock() loginsSeenAt = time.Time{} loginsMu.Unlock() + // an account asked for its list a moment ago is asked again: the + // accounts read afresh may be others under the same id + newFetches.Lock() + clear(newFetches.m) + newFetches.Unlock() forgetAccountCaches() }