[GH-ISSUE #6578] [Issue]: request-timeouts e2e flakes on mobile-webkit because the settings search jump takes focus mid-fill #3687

Closed
opened 2026-10-21 06:06:06 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @kolacheee on GitHub (Sep 23, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/6578

Originally assigned to: @SpicyMarinara on GitHub.

e2e/afternoon-sweep.e2e.ts:230 ("request timeouts can be found, saved and reloaded in Advanced Settings") fails intermittently on mobile-webkit. The test types 1234 into Text generation and saves, but the server keeps 300:

Expected: 1234
Received: 300
> 248 | await expect.poll(async () => (await (await request.get("/api/admin/request-timeouts")).json()).chat).toBe(1234);

Cause

Clicking a settings search result calls jumpToSearchResult in packages/client/src/components/panels/SettingsPanel.tsx. It switches the tab right away, then waits two animation frames before it scrolls to the section and moves focus onto it with focusTarget?.focus({ preventScroll: true }).

The test does not wait for that focus move. It checks the field's value and starts fill("1234") as soon as the section renders. On the slow mobile WebKit runner, the two frames land in the middle of the fill:

  1. fill focuses the Text generation input.
  2. The delayed jump moves focus to the section.
  3. The input's blur commits its unchanged draft (300), which enables Save timeouts.
  4. The typed text goes to the section, which is not editable, so it is lost.

The test then blurs and clicks Save timeouts, and the app saves 300.

Evidence from the trace

Run https://github.com/Pasta-Devs/Marinara-Engine/actions/runs/35901562180, artifact playwright-mobile-webkit-shard-1-failure:

  • The browser's only PUT /api/admin/request-timeouts body is byte-identical to the preceding GET response, so the app saved the original values.
  • The DOM snapshot taken right before the test's blur already shows the input at 300.
  • A screencast frame taken during the fill shows the panel still at the top of the Advanced tab: the jump had not scrolled yet. The next frame shows the page scrolled to Request timeouts, with the focus ring on the section.

The same failure, with the same values, happened on an unrelated branch: https://github.com/Pasta-Devs/Marinara-Engine/actions/runs/35769236205 (codex/sept22-gpt6-sol-luna, 2026-09-22). Neither branch touches the settings panel or request timeouts.

Suggested fix

In the test, wait for the jump to finish before editing, the same way a user would. For example, after openTimeouts():

await expect(page.locator("#settings-section-request-timeouts")).toBeFocused();

Putting it at the end of openTimeouts() covers both of its calls.

Originally created by @kolacheee on GitHub (Sep 23, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/6578 Originally assigned to: @SpicyMarinara on GitHub. `e2e/afternoon-sweep.e2e.ts:230` ("request timeouts can be found, saved and reloaded in Advanced Settings") fails intermittently on `mobile-webkit`. The test types 1234 into **Text generation** and saves, but the server keeps 300: ``` Expected: 1234 Received: 300 > 248 | await expect.poll(async () => (await (await request.get("/api/admin/request-timeouts")).json()).chat).toBe(1234); ``` ## Cause Clicking a settings search result calls `jumpToSearchResult` in `packages/client/src/components/panels/SettingsPanel.tsx`. It switches the tab right away, then waits two animation frames before it scrolls to the section and moves focus onto it with `focusTarget?.focus({ preventScroll: true })`. The test does not wait for that focus move. It checks the field's value and starts `fill("1234")` as soon as the section renders. On the slow mobile WebKit runner, the two frames land in the middle of the fill: 1. `fill` focuses the **Text generation** input. 2. The delayed jump moves focus to the section. 3. The input's blur commits its unchanged draft (300), which enables **Save timeouts**. 4. The typed text goes to the section, which is not editable, so it is lost. The test then blurs and clicks **Save timeouts**, and the app saves 300. ## Evidence from the trace Run https://github.com/Pasta-Devs/Marinara-Engine/actions/runs/35901562180, artifact `playwright-mobile-webkit-shard-1-failure`: - The browser's only `PUT /api/admin/request-timeouts` body is byte-identical to the preceding `GET` response, so the app saved the original values. - The DOM snapshot taken right before the test's `blur` already shows the input at `300`. - A screencast frame taken during the fill shows the panel still at the top of the Advanced tab: the jump had not scrolled yet. The next frame shows the page scrolled to **Request timeouts**, with the focus ring on the section. The same failure, with the same values, happened on an unrelated branch: https://github.com/Pasta-Devs/Marinara-Engine/actions/runs/35769236205 (`codex/sept22-gpt6-sol-luna`, 2026-09-22). Neither branch touches the settings panel or request timeouts. ## Suggested fix In the test, wait for the jump to finish before editing, the same way a user would. For example, after `openTimeouts()`: ```ts await expect(page.locator("#settings-section-request-timeouts")).toBeFocused(); ``` Putting it at the end of `openTimeouts()` covers both of its calls.
bsakaguchi 2026-10-21 06:06:06 +07:00
Author
Owner

@SpicyMarinara commented on GitHub (Sep 23, 2026):

Codex is taking this for @SpicyMarinara in draft PR #6585. I am tracing the existing behavior and adding focused regression coverage.

<!-- gh-comment-id:5803965566 --> @SpicyMarinara commented on GitHub (Sep 23, 2026): Codex is taking this for @SpicyMarinara in draft PR #6585. I am tracing the existing behavior and adding focused regression coverage.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#3687
No description provided.