mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #7209] [MERGED] test(e2e): make the 5,001-row trash batching proof reliable on slow WebKit #7624
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#7624
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/7209
Author: @SpicyMarinara
Created: 10/7/2026
Status: ✅ Merged
Merged: 10/7/2026
Merged by: @SpicyMarinara
Base:
staging← Head:test/trash-batching-timing📝 Commits (2)
cd4c8b8test(e2e): make the 5,001-row trash batching proof reliable on slow WebKit2d7b8c4test(e2e): keep the trash toast visibility check in the mount record📊 Changes
1 file changed (+41 additions, -12 deletions)
View changed files
📝
e2e/message-trash-batching.e2e.ts(+41 -12)📄 Description
Linked issue
No linked issue: CI flake found while validating #7194; see #7200 for the related phone flake.
Why this change
e2e/message-trash-batching.e2e.tsfailed both of its tests twice in a row on CI mobile-webkit (run 37542395904, shard 8: original run and rerun) while #7194 was being validated. #7194 doesn't touch trash code. Adding a spec file reshuffled the shards and moved this file into a heavier one. The CI traces show two timing problems in the test, not a product regression:waitForcaught it in that window. The follow-uptoHaveAttribute("data-type", "warning")then found no element (element(s) not found). On a slow runner, each separate locator check on the toast races the same timer.The same trace shows a near miss too:
toBeDisabled()after clicking Restore all took 7.8 s of its 10 s budget, because disabling every row's buttons re-renders all 5,001 rows.The fix keeps everything the test proves: batching into 5,000 + 1, partial-failure retry, conflicts-only batches, the warning toast's type, title and description (or lack of one), and that the toast was visible. Only the timing budgets change, and the toast race is fixed by recording the toast when it mounts.
What changed
e2e/message-trash-batching.e2e.tsonly (test-only, so no CHANGELOG entry):MutationObserverthat records each sonner toast as it mounts. It records the toast'sdata-type, title and description, and whether it is visible by Playwright's definition (non-empty box and notvisibility: hidden). Oneexpect.poll(...).toContainEqual(...)then asserts{ visible: true, type: "warning", title: "Synthetic later-batch failure", description: "4999 messages restored" | null }. This replaces thewaitFor+toHaveAttributepair and the later description checks ([data-description]count 0 /getByText("4999 messages restored")), which raced the same 6 s timer. The conflicts-only[data-description]count of 0 could also pass vacuously once the toast was gone._expectInternal). That's why the failedtoHaveAttributeabove ran 11 s.For the maintainer, product note (not changed here): with 5,001 trash rows on a slow device, a user sees the same thing CI did. The page freezes for several seconds, and the restore-failure warning can flash for under a second before its 6 s timer runs out. Rendering the trash list in pages or virtualizing it would fix both.
Validation
pnpm checkpasses locallyCONTRIBUTING.mdAgent-run checks (for the reviewer to confirm, not ticked):
pnpm checkandpnpm exec prettier --check e2e/message-trash-batching.e2e.tsexit 0 on this branch and onhotfix/termux-2.5.0-fixes.playwright test e2e/message-trash-batching.e2e.ts --project=mobile-webkit --project=desktop-chromiumpasses on both branches, including--repeat-each=2.--repeat-each=5 --workers=6on mobile-webkit, alongside the CI shard-8 neighbours (multiplayer-controls, lorebook-images, markdown-blocks, message-marks-colors), gave 10/10 trash runs passing in 40 s–1.4 min. The only failure in that run was an unrelated cold-startmarkdown-blocksblockquote count.locator.waitFor: Timeout 10000ms exceeded(CI failure 1).--repeat-each=4: 3/4 conflicts-only runs failed withtoHaveAttribute … Expected: "warning" … element(s) not found(CI failure 2).--repeat-each=4: 8/8 pass. New spec with all three blocks stacked: 6/6 pass on WebKit (78–84 s each, hence the 120 s test timeout) and 4/4 on Chromium.type: "error"fails with the recorded toast{ visible: true, type: "warning", title: "Synthetic later-batch failure", description: "4999 messages restored" }(anddescription: nullin conflicts-only).Manual verification notes
mobile-webkitshard containingmessage-trash-batching.e2e.tspasses in this PR's CI.Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)The same two commits are on the #7194 hotfix branch (
888e0111b,1fb1c7b1c).UI evidence (if applicable)
Not applicable (test-only).
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.