mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #7229] [MERGED] test(e2e): isolate the trash feature toggle and settle edge-docked phone tools #7636
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#7636
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/7229
Author: @SpicyMarinara
Created: 10/7/2026
Status: ✅ Merged
Merged: 10/7/2026
Merged by: @SpicyMarinara
Base:
staging← Head:test/flaky-trash-and-docked-tools-7220📝 Commits (1)
572d460test(e2e): isolate the trash feature toggle and settle edge-docked phone tools📊 Changes
2 files changed (+54 additions, -13 deletions)
View changed files
📝
e2e/message-marks-trash.e2e.ts(+51 -13)📝
e2e/phone-bubbles.e2e.ts(+3 -0)📄 Description
Linked issue
Closes #7220
Why this change
Two e2e tests failed now and then even though the app behaved correctly. Each failure blocks or slows unrelated PRs, and each was caused by the test, not by the app.
e2e/message-marks-trash.e2e.tsunder parallel workers. The test turns on the global Message Trash switch, then sets it back to the value it saved at the start. The mobile projects and--repeat-eachcopies share one server, so this sequence breaks it: run A saves "off" and turns trash on, run B starts and saves "on", then A finishes and turns trash off while B is still running. B's fixture delete then removes the message for good, returning{ trashed: false, trashedCount: 0 }at thetrashed: truecheck. Reproduced onstagingdeterministically: one roleplay copy waits 3 s before starting and 15 s before its delete, and that copy fails at exactly that line.e2e/phone-bubbles.e2e.ts› "edge-docked phone Chat tools stay centered above and below their launcher". When the loop switches to the large (96 px) buttons,toHaveCSS("width", "96px")can pass as soon as styles recalculate. The launcher is only moved back inside the chat when itsResizeObserverfires in the next frame. Measured in WebKit: when the width first reads 96px, the launcher is still aty 531.5and overhangs the message box. The first rAF after that still reads531.5. By the second rAF it has been re-clamped toy 471.5. If the nextdragBubblereads the box in that window, it grabs 12 px below the real launcher. The drag misses, the launcher stays docked bottom-left, its menu opens above, and the "below" check atphone-bubbles.e2e.ts:~1006fails. This is the same class of problem as #7200/#7216: measuring before things settle.What changed
Test-only. No app code, docs or CHANGELOG entry.
message-marks-trash: the copies that need Message Trash now share it instead of each saving and restoring it on its own. A smallholdMessageTrashhelper keeps a holder count in.tmp/playwright-data/message-trash-<port>/(reset whenever the e2e servers start). The first holder saves the original feature settings, every holder makes sure trash is on, and only the last holder restores the saved settings. If that restore fails, the saved original is kept for the next run. A shortmkdirlock guards only those two settings calls, so the tests still run in parallel. I tried the suite's existing whole-testmkdirlock (expression-active-sprites.e2e.ts) first. It removed the race, but under--repeat-each=3/4 --workers=4it queued up to eight copies, and some timed out waiting for the lock. That is why I used a shared hold instead. The test's assertions are unchanged.phone-bubblesedge-docked test: after each size change, call the existingexpectComposerClearAndNoSideScroll(page)(#7216's helper) before dragging. It waits until every button holds still for 3 frames, then checks that none sits on the message box. So the drag reads the re-clamped launcher, and the clamp the test relies on is now asserted too. The test's other assertions are unchanged.Validation
pnpm checkpasses locallyCONTRIBUTING.mdAgent-run evidence (local macOS, Playwright 1.63; boxes above left for the human reviewer):
Trash toggle (
message-marks-trash)--repeat-each=3 --workers=4and--project=mobile-webkit --project=mobile-chromium --repeat-each=4 --workers=4passed 3 times on untouchedstaging(6/16 tests each). The race window is narrow.staging(temporary change, reverted): the roleplay copy withrepeatEachIndex === 1waits 3 s before saving the settings and 15 s before its delete. Result:1 failed, withExpected trashed: true, trashedCount: 1/Received trashed: false, trashedCount: 0at the fixture-delete check (message-marks-trash.e2e.ts:155on staging).--project=mobile-webkit --repeat-each=3 --workers=4: 6 passed, twice.--project=mobile-webkit --project=mobile-chromium --repeat-each=4 --workers=4: 16 passed.--project=mobile-webkit --project=mobile-chromium --repeat-each=3 --workers=4: 12 passed in each of 5 runs. After every run,GET /api/app-settings/featuresreturned{"settings":{}}, the original, and the hold file readholders: 0.{"stableLorebookGroupPicks":true}kept in the hold file). The next run passed and restored{"stableLorebookGroupPicks":true}.chatUsesMessageTrashalways returns false. Both copies fail atexpect(await deleted.json()).toEqual({ trashed: true, trashedCount: 1 }), and the second copy still got the hold after the first failed.mkdirlock removed the race, but under--repeat-each=3 --workers=4(1 of 6) and both mobile projects--repeat-each=4 --workers=4(2 of 16) some copies failed withEEXISTafter waiting 60 s for the lock.Edge-docked phone Chat tools (
phone-bubbles)--repeat-each=5full-spec WebKit run passed on untouchedstaginghere (65 passed, 15 project skips). The test on its own passed 10/10 unloaded and 12/12 under CPU load (8yesprocesses on 10 cores). So I measured the mechanism instead.96pxisy 531.5(overhanging the message box). The 1st rAF still reads531.5. The 2nd reads471.5, the re-clamped spot.staging(temporary init script delayingResizeObservercallbacks by 30 ms, about two frames, reverted): 3 of 4 failed at the "below" check withExpected: >= 567.5, Received: 58.83. The 96 px launcher stayed bottom-left because the drag grabbed the stale box, and the menu opened above it.-g "edge-docked" --repeat-each=10 --workers=1: 10 passed.--repeat-each=12: 12 passed.--project=mobile-webkit --project=mobile-chromium --workers=1: 27 passed, 5 skipped (existing project skips).WindowBubbleclamps with the 36 px default instead of the rendered size, so a grown launcher is never moved back. The new wait at line 964 fails withsettled: true, overlap: ["chat-tools-menu"]. The wait does not hide a real clamp bug.Expected: <= 1, Received: 10.Checks
pnpm checkpassed on the final commit.coderabbit review --agent --committed, one run) returned 2 findings:ponytail:comment, and it matches the suite's existing lock pattern (expression-active-sprites.e2e.ts). The lock covers only two settings calls and is released infinally, including after a timeout tears down the request fixture. A stale holder only leaves trash on until the e2e servers restart and reset.tmp/playwright-data.Manual verification notes
pnpm regression:ui e2e/message-marks-trash.e2e.ts --project=mobile-webkit --repeat-each=3 --workers=4and confirm 6 passed.pnpm regression:ui e2e/message-marks-trash.e2e.ts --project=mobile-webkit --project=mobile-chromium --repeat-each=4 --workers=4and confirm 16 passed.pnpm regression:ui e2e/phone-bubbles.e2e.ts --project=mobile-webkit --repeat-each=5 --workers=1and confirm no failures (skips are the spec's existing project skips).PLAYWRIGHT_SKIP_WEBSERVER=true), manually check thatGET /api/app-settings/featuresreturns the settings it had before the run.Docs and release impact
docs-i18nbranch updated to match, or a[docs-i18n]follow-up issue opened (see CONTRIBUTING.md § Translated documentation)Test-only change: no user-facing docs or CHANGELOG entry.
UI evidence (if applicable)
Not applicable (test-only).
Summary by CodeRabbit
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.