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.
This commit is contained in:
yetone committed 2026-10-06 03:48:13 +08:00
1 parent b363327d4e
commit bfe8bcafb8
1 file changed
+5
+5
View File
@@ -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()
}