fix: retry gather/attack with a progress-based give-up (isolated retest)

Testing this in isolation from the anti-throttle Chromium flags and
the DB-lock change (reverted separately, ruled out on its own): the
single fire-and-forget gather/attack action has no recovery if the one
evaluated frame doesn't line up with the authoritative server position
-- confirmed by live-instrumenting the unpatched code locally and
watching it hang. This reinstates the fix from the earlier round, with
both bugs found via live diagnostic testing already fixed going in:

- Retries at a conservative cadence (~0.3s, well under the intent rate
  limit) instead of firing once and giving up forever.
- Gives up on a target only once an actual progress signal (target HP
  for attack, held-item count for gather/loot) has stopped moving for
  a wall-clock budget -- not "hasn't succeeded since the click" (which
  wrongly aborts mid-fight during a normal cooldown lull) and not a
  frame/attempt count (which balloons into tens of real seconds on a
  tab with sparse rendered frames).
- The dedicated boss-attack button now also resets the progress clock;
  it used to bypass action() entirely and read an uninitialized clock,
  immediately abandoning the boss for the nearest mob on click.

Deliberately NOT re-adding the Chromium anti-throttle flags this round
-- keeping this an isolated variable after the last round's session
crash coincided with adding them.

Also bumped one unrelated, independently-diagnosed timeout: the
post-death new-character join in portal.spec.ts was polling on
Playwright's default 5s timeout for a fresh join's first snapshot,
with no connection to the retry logic above.

Verified: tsc/build clean, three full local e2e runs (7/7 each).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
dingo
2026-09-06 14:06:26 -04:00
co-authored by Claude Sonnet 5
parent 7375fc6638
commit db70920640
2 changed files with 55 additions and 7 deletions
+2 -1
View File
@@ -52,7 +52,8 @@ test('admin actions are audited and death permits a distinct replacement', async
await page.getByLabel('Character name', { exact: true }).fill('Portal second life');
await page.getByRole('button', { name: 'Enter world' }).click();
await expect(page.locator('#connection-status')).toHaveText('Connected');
await expect.poll(() => page.evaluate(() => (window as any).__aeternalis?.snapshot?.self?.entity?.id)).toBeTruthy();
// Default 5s poll was too tight for a fresh join's first snapshot on slow CI hardware.
await expect.poll(() => page.evaluate(() => (window as any).__aeternalis?.snapshot?.self?.entity?.id), { timeout: 15000 }).toBeTruthy();
const current = await page.evaluate(() => (window as any).__aeternalis.snapshot.self.entity.id);
expect(current).not.toBe(old.entity.id);
const account = await (await page.request.get('/api/account')).json();