Commit Graph
3 Commits
Author SHA1 Message Date
yetone ce8b67de37 gui tests: a page's first load gets a minute, not a click's 5s (#4470)
claude-switch-only set page.setDefaultTimeout(5000) and then called
page.goto with no timeout of its own, so Playwright held the first load
of app.js, i18n.js and the plugins to the 5s bar meant for clicks. On a
busy box (a whole-suite run at load 130-160) that load took longer and
goto timed out. The same pattern is in 988 GUI test files (1174 pages):
every one of them now also sets setDefaultNavigationTimeout(60000) on
the same page, right after its default, so goto, reload and waitForURL
wait on the load itself with room, while clicks and waits keep their
short bar. group-from-model-add's own 20s navigation bar is raised to the
same minute. claude-switch-only also gives its first provider row (drawn
from the page's first reads) a minute before clicking it.

nav-timeout.test.cjs (no browser) reads every GUI test file and names
each page given a default under a minute without a navigation timeout of
at least a minute, so a new file can't bring the pattern back.

What was run (WSL magpie-desktop, Playwright 1.62.0, load 70-260 from
other sessions):
- node --check on every file in internal/gui/tests: all parse.
- nav-timeout.test.cjs against origin/main's test files: red (names the
  1174 pages); against this tree: its only reds were my own probe copies
  of the old files, since removed.
- By hand: claude-switch-only with app.js served 7s late (a busy box's
  first load), --test-name-pattern "1100 en": origin/main's file 4 of 4
  red with "page.goto: Timeout 5000ms exceeded"; this file 4 of 4 green.
- claude-switch-only.test.cjs, both engines, en/zh/ja/de, 1100 and 420:
  32 of 32. group-from-model-add, usage-access-key-card and i18n-keys:
  green. agent-plugin-agents: Chromium green; WebKit's de 420 subtest red
  on a 5s waitForFunction at line 115 (a wait after load, not the
  navigation), at load ~230.

Not tried: the whole GUI suite (about 1000 files; the change is one
mechanical line per page), Windows or mote (mote's browsers, #4125).
2026-10-31 02:09:18 +08:00
yetone a77b5b4fc9 gui: Check in now says what the press came to, not "refreshed" (#3326)
Promised to connoryang331 on #3326: a press of Check in now said "Check-in
status refreshed" whatever happened. It now says, in the same toast, a
count per kind (checkinPressSaid): "Claimed: 1 (+200 credits)",
"Already checked in today: N", "Not available yet: N" (inactive,
ineligible, or an "already" magpie asks again), "Check in in its own app:
N" (captcha, Trae's 9074), "Check-in failed for N account(s)" (red, as
before). No layout change. en, zh, zh-TW, ja, de.

A result counts as claimed now only when the vendor was asked on this
press: WorkBuddyCheckin.Asked is now sent as "asked" (omitempty). It is
still never kept: checkinNow writes the file before setting it. An
account claimed earlier today, settled and not asked, counts as already.
The TUI and CLI already say each account's result ("+N", "· already"),
unchanged.

app.js and the core budget: +771 bytes over the previous commit, 349 over
the budget after compacting the helper, raised by exactly that with the
reason in core_budget_test.go (the check-in row is the core's, the tray
panel draws it too).

Tests:
- checkin-early-done.test.cjs: the press's toast is "Claimed: 1 (+200
  credits)" in each language, and checkinPressSaid's text for already,
  not yet and a mix (claimed x2 +150, already, failed), bad = 1 for a
  failure. qoder-checkin-recheck.test.cjs now wants "Not available yet:
  1" for its inactive press.
- Red on the previous commit's app.js: both files 0/20 in Chromium.

Run at this tree:
- GUI: checkin-account, checkin-early-done, i18n-keys, plugin-checkin,
  qoder-checkin-recheck, usage-card-refresh, usage-checkin, Chromium and
  WebKit: 177/179; the 2 reds are usage-checkin's WebKit Qoder check-in
  tab, red alone on origin/main 0815c9186 (#2549, #3091).
- go test -tags nogui ./internal/gui/ -run Budget, ./internal/provider/
  -run 'Checkin|CheckIn': ok.
- Full suite: set -o pipefail; go test -tags nogui -timeout 45m ./...
  at 70c6bb072 (this tree on the previous commit), sandbox HOME: 69
  packages ok, exit 0. go vet of internal/gui and internal/provider on
  darwin, linux (nogui) and windows clean; gofmt -l clean.

Not tried: a press against a real vendor account.
2026-10-23 19:03:58 +08:00
yetoneandLoKi 21f7f9df23 checkin: the Qoder plugins' check-in is asked again within the day, as the built-in's was (#2696)
The native Qoder and Qoder CN plugin check-in (pluginCheckinProvider) built
its checkiner without recheck, while the built-in qoderCheckiner set it.
So an inactive or done result was kept for the whole Beijing day, and a
press of "Check in now" was answered from that record too. Qoder CN's
campaign runs 10:00 to 09:59 the next day (mufanmu), so an early read
describes yesterday's campaign and said nothing about today's.

What changed:
- provider: pluginRechecks(id) is true for "qoder" and "qoder-cn" only,
  and sets recheck on their checkiner. A press asks at once. The loop asks
  again after wbCheckinEvery (30m) for inactive and done. Every other
  plugin stays settled for the day.
- GUI (checkinRow): a Qoder account (built-in or plugin) whose check-in
  found no campaign today keeps "Check in now". A press reports "Check-in
  status refreshed" instead of "Checked in", since it may still find
  none. The unused "Checked in" key is replaced in all four languages.
- docs/subsystems/provider-plugins.md names the exception and the tests.

Taken from LoKi's (lokic7123-star) patch on the issue: the recheck on the
Qoder plugin ids, the Check in now button for an inactive Qoder card, and
the neutral press status. Their GUI test was adapted into
qoder-checkin-recheck.test.cjs.
Left out, as the earlier review asked: the blanket 30-minute message, the
UTC timestamps and the client-computed next check. Also left out: the
"Already checked in today" wording and the "· credit" display. That is
not this bug, and the TUI and CLI would need the same change.

Run:
- Red on the old code:
  - All 8 subtests of TestPluginCheckinQoderRechecksCampaigns
    ({qoder,qoder-cn} x {inactive,done} x {loop,press}) fail without
    the fix.
  - Forcing recheck on for every plugin turns
    TestPluginCheckinOthersSettledForTheDay red.
  - qoder-checkin-recheck.test.cjs is red on the origin/main assets (no
    .ci-now on the card).
- At 91bb01e65 (base 9572a3576):
  - Full suite: set -o pipefail; go test -timeout 45m ./... |
    tee. EXIT=0, 68 packages ok, run alone on the machine.
  - qoder-checkin-recheck.test.cjs passes 20/20: chromium and webkit,
    en/zh/zh-TW/ja/de, 900 and 440px.
  - 76 GUI files reachable from the change were run: check-in files,
    gui-*, i18n-keys and tray-usages. Reds:
    - login-import, chromium en/zh: red on main too (#1307).
    - quota-reads webkit de 360: red on main too (#2150, commented
      with its c.toFixed page error).
    - usage-checkin webkit en/zh, Qoder tab: red on main too (#2549).
    - update-wait chromium en and usage-alert webkit en: red only
      under load, pass alone (#3275).
- At this tree, rebased on 87d703c5c (b91bcf260, library only, came
  after). The 8 new main commits since
  9572a3576 bring app.js, i18n.js and provider plugin changes; none of
  them touches check-in code.
  - gofmt -l: clean.
  - go vet ./...: clean on darwin, linux (-tags nogui) and windows.
  - go test ./internal/provider/ ./internal/gui/ ./internal/plugin/
    ./internal/cli/: all ok. internal/gui includes TestCoreScriptBudget.
  - GUI, both engines: qoder-checkin-recheck, i18n-keys,
    plugin-checkin, checkin-account, account-models and
    plugin-keyless-signin pass 119/119.

Not tried:
- No real Qoder or Qoder CN account, and no campaign that opens
  mid-day.
- The full GUI suite: another session's full GUI run held the machine,
  so 76 files were run instead.
- Linux and Windows at runtime.

Reported by mufanmu and LoKi; patch by LoKi.

Co-authored-by: LoKi <317300729+lokic7123-star@users.noreply.github.com>
2026-10-22 21:18:13 +08:00