Commit Graph
2 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 7faea508f6 settings: Custom proxy brings back the last address and login (Zane)
Zane on Discord: in Settings' proxy, Off saves "direct" and Auto saves
"", so the Custom address and its user and password were gone the next
time Custom was picked. settings.Save now keeps the last proxy of the
user's own as proxyCustom (set only from Proxy, never from the page; the
POST /api/settings handler copies the saved one over what the page
sends). It is stored as Proxy is: plainly in settings.json, as before,
the same as the proxy itself, nowhere more plainly. KeepOwn keeps it this
computer's own, as Proxy, so sync and restore never carry another
computer's. Custom picked after Off or Auto fills its fields from it;
nothing that reads settings.proxy changes, and Off and Auto still send
requests as they did.

Run at base 61b92529e (this tree):
- go test ./internal/settings ./internal/backup ./internal/davsync
  ./internal/netproxy: ok. TestProxyCustomRemembered (gui, through
  Handler) and TestProxyCustomOwn (settings): ok.
- settings-proxy-remember.test.cjs (new; en, zh, zh-TW, ja, de, chromium
  and webkit): Custom with user "名 a@b" and password "p@ss 密" -> Off ->
  Custom shows the same address and user; the same after a reload and
  after Auto; an unsaved draft is not what comes back; the page never
  posts proxyCustom. 10/10.
- TestSettingsSaveKeepsWhatItDoesNotSend (the guard that every field
  the page doesn't send outlives its save) now sets ProxyCustom; red
  without the api.go line.
- settings-proxy-auth, proxy-test, proxy-own-wording: 54 pass.
- Full GUI suite (make test-ui, both engines) on a copy of this tree:
  11735 tests, 70 red over 23 files at load ~150-260. Run again two at a
  time, 15 of those files pass; the other 8 are red on origin/main
  8278fd9b0 too, run the same way, and are filed: mobile-web (#2658),
  quota-count-wrap and quota-name-translated (#2228), s3-sync (#2448),
  usage-agents-hide and usage-fold (#2399), usage-checkin (#2549, #3091),
  usage-ledger (#3104).
- gofmt -l clean; go vet darwin, GOOS=linux -tags nogui, GOOS=windows: ok.

Broken by hand, each red, then put back:
- no proxyCustom in save(): TestProxyCustomRemembered red.
- no KeepOwn line: TestProxyCustomOwn red.
- no api.go line (page's value taken): the GUI test red.
- renderProxy filling from "" again: the GUI test red in chromium.

Not tried: the real app with a real SOCKS proxy that needs a login;
a sync between two real computers.
2026-10-23 02:39:33 +08:00