A plugin's check-in can answer failed with an until hours away: ZCode
rate limits a claim read, and its plugin (plugins#793) says when to ask
again. magpie asked any failed again after 30 minutes whatever the until
said, the half hour that kept the limit on (#503: "gift plans to claim:
Too Many Requests" 180 times over four days). A review probe on
origin/main 19c45d5d4 saw a failed with until 6h out asked at 31 minutes
and at 2 hours.
Now heldUntil holds a failed whose until is later than its own retry
until that time, at most 24 hours after the failure (checkinHoldMax), so
a wrong far-off until can't stop check-ins for good. Every path that
schedules a check-in follows it:
- settled: the loop doesn't ask before it, across the Beijing day's turn
too; a press (soon) still asks at once.
- the recheck branch (ZCode, Qoder) counts a held failure as waiting,
where it was otherwise asked again every 30 minutes.
- the loop's wake time (wbCheckinLoop.again) is the until, not 30
minutes on.
A failed with no until keeps the 30-minute retry (offline failures their
minute ladder), and one with an until sooner than the retry is asked at
the until, as before. The GUI and TUI show no time for the next ask
("magpie tries again later"), so nothing there changed.
docs/subsystems/provider-plugins.md says it.
Run (mote, through mote-run):
- go test -count=1 -timeout 30m ./internal/provider/ ./internal/tui/
./internal/cli/: ok (193.7s, 17.1s, 76.6s).
- go vet, GOOS=linux go vet -tags nogui, GOOS=windows go vet on
./internal/provider/: ok. gofmt -l: nothing.
- The full suite runs after the push, through the suite lock.
Broken by hand (new tests TestPluginCheckinFailedWaitsForUntil,
TestPluginCheckinFailedUntilBounded):
- the old settled/checkin.go/tick: red, "loop at +31m0s: asked again
(2 asks), until ..." for zcode and a plain plugin, and the far until
case asked at +31m.
- the recheck branch without the held failure: zcode red at +31m.
- the old wake time: "the loop wakes at 14:30, want the until 20:00".
- no 24h cap: "at +24h0m0s: not asked again".
Restored: ok.
Not tried: a real ZCode account rate limited with until; the plugin's
own backoff (plugins#793) still holds off for older magpie.
Reported-by: kongbai01203 (plugins#503)