Files
magpie/internal
yetone c087834d6f provider: rememberLogins checks the time before it takes logins.json's lock
#1665, owner's item 1: rememberLogins took loginsMu first. That made and
locked logins.json.lock even when it then saw that 30 seconds hadn't
passed since its last look and returned. It is asked on every account
list and every page's read: ~370 times in a Windows start's first 25s in
the report, each one a file the antivirus filter driver works on.
loginsSeenAt is now an atomic.Int64, so the time can be read without the
lock. A look that isn't due returns before the lock. A due look checks
again under the lock, in case another ask looked while it waited.
switchSavedLogin, ForgetAccounts and the tests that reset the time now
Store(0).

TestRememberLoginsNotDueTakesNoLock holds loginsMu and asks 100 times
just after a look. It expects the asks to return within 5s, and a due
ask to look. With the check before the lock removed by hand, it goes red:
  --- FAIL: TestRememberLoginsNotDueTakesNoLock (5.67s)
      logins_due_test.go:30: a look not due waited for logins.json's lock

What was run (worktree at 9fd80b212 plus this change and the commits
before it):
  gofmt -l internal/: nothing
  go vet on the touched packages: exit 0
  GOOS=linux go vet -tags nogui ./...: exit 0
  GOOS=windows go vet -tags nogui ./...: exit 0
  go test -timeout 45m -count=1 ./internal/provider: ok 696.341s
2026-10-20 20:23:55 +08:00
..
…
…