[PR #7233] [MERGED] test(e2e): cover the trash's deleting status and release a failed trash hold #7638

Closed
opened 2026-10-24 04:06:04 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/7233
Author: @SpicyMarinara
Created: 10/7/2026
Status: ✅ Merged
Merged: 10/7/2026
Merged by: @SpicyMarinara

Base: staging ← Head: test/trash-followups


📝 Commits (1)

  • 48a18a9 test(e2e): cover the trash's deleting status and release a failed trash hold

📊 Changes

2 files changed (+63 additions, -21 deletions)

View changed files

📝 e2e/message-marks-trash.e2e.ts (+41 -21)
📝 e2e/message-trash-responsive.e2e.ts (+22 -0)

📄 Description

Important

Contributions target staging. Only SpicyMarinara may promote this repository's staging branch or a same-repository hotfix/* branch to main.
Outside and first-time contributors also require an approving review from SpicyMarinara.

Linked issue

Refs #7210, #7220

This is the follow-up promised in two CodeRabbit threads that were deferred so their PRs could land:

Why this change

  • #7226 added a status line that says why trash rows pause: "Restoring messages…" or "Deleting messages…". Only the restore wording was checked by a test. The delete wording was checked by hand only, so a regression that showed the wrong text during a delete would pass CI.
  • #7229 added holdMessageTrash, which lets parallel e2e runs share the global Message Trash switch. It saves this run's hold to holders.json before it removes its lock. If removing the lock fails, the helper rejects before it returns its release callback. The test calls the helper before its try/finally, so nothing ever releases that hold. Message Trash then stays on, and the holder count stays wrong, until the e2e servers restart.

What changed

Test-only. No app code, docs or CHANGELOG entry.

  • e2e/message-trash-responsive.e2e.ts: after the existing restore checks, the test empties the trash (Empty trash, then "Click again to empty") while page.route holds the /trash/delete request. It checks that the role="status" region reads "Deleting messages…" while the request is pending, and is empty again once it finishes. It also checks that exactly one { all: true } delete was sent. The held request is released in finally, like the restore. Existing assertions are unchanged.
  • e2e/message-marks-trash.e2e.ts: holdMessageTrash now takes back its own hold if letting go of the lock fails after the hold was counted. The lock is still held at that point, so the helper decrements the holder count, restores the original settings if it was the last holder, writes the file and tries to remove the lock again. Other active holders keep their holds. It then rethrows the original error. If the rollback fails too, it throws an AggregateError with both errors. The lock-release steps and the release logic are now small shared helpers (unlock, release), so the normal release and the rollback use the same code.

Validation

  • pnpm check passes locally
  • Container (Docker / Podman) built and ran without issue
  • Ran the app, clicked through the changes manually
  • Checked edge cases (light + dark mode, mobile viewport, empty states, error paths)
  • Above manual verification completed (describe below)
  • Read and followed CONTRIBUTING.md

Agent-run evidence (local macOS, Playwright 1.63; the boxes above are left for the human reviewer):

  • pnpm exec playwright test e2e/message-trash-responsive.e2e.ts e2e/message-marks-trash.e2e.ts --project=desktop-chromium --project=mobile-webkit --workers=1 --repeat-each=2: 12 passed, on this branch rebased onto staging after #7226 and #7229 merged.
  • Mutation check for the delete status (temporary app change, reverted): ChatTrashList showed the restore wording for deletes too. The test failed on both projects at the new assertion: Expected: "Deleting messages…", Received: "Restoring messages…".
  • Rollback proof (temporary spec built from the helper's source, with lock removal set to reject once; deleted afterwards):
    • Lone holder: the hold rejects with the lock error, holders.json reads { holders: 0 }, the lock is gone, and the feature settings equal the original.
    • With another active holder: that holder keeps its hold ({ holders: 1, original }), Message Trash stays on, and the lock is gone. Releasing the other holder then restores the original settings.
    • The same proof against the helper on staging fails: holders.json still reads { holders: 1, original: {} } after the rejected hold.
  • pnpm check passed on the final commit.
  • Local CodeRabbit (coderabbit review --agent --committed) returned rate_limit (43 minutes) and did not review this commit. The GitHub CodeRabbit review has not run yet either.

Manual verification notes

  • Manually run pnpm regression:ui e2e/message-trash-responsive.e2e.ts --project=desktop-chromium --project=mobile-webkit --workers=1 and confirm both pass.
  • Manually run pnpm regression:ui e2e/message-marks-trash.e2e.ts --project=mobile-webkit --project=mobile-chromium --repeat-each=2 --workers=4 and confirm no failures.
  • Manually check in the browser that emptying a large trash shows "Deleting messages…" over the dimmed rows, and that the line clears when it finishes.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed
  • Translated docs on the docs-i18n branch updated to match, or a [docs-i18n] follow-up issue opened (see CONTRIBUTING.md § Translated documentation)
  • Version/release files updated (only if this PR includes a version bump)

UI evidence (if applicable)

Not applicable: test-only change.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/7233 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 10/7/2026 **Status:** ✅ Merged **Merged:** 10/7/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `test/trash-followups` --- ### 📝 Commits (1) - [`48a18a9`](https://github.com/Pasta-Devs/Marinara-Engine/commit/48a18a9858d7f8b57532b2eb80ad9acd78d94593) test(e2e): cover the trash's deleting status and release a failed trash hold ### 📊 Changes **2 files changed** (+63 additions, -21 deletions) <details> <summary>View changed files</summary> 📝 `e2e/message-marks-trash.e2e.ts` (+41 -21) 📝 `e2e/message-trash-responsive.e2e.ts` (+22 -0) </details> ### 📄 Description > [!IMPORTANT] > Contributions target `staging`. Only `SpicyMarinara` may promote this repository's `staging` branch or a same-repository `hotfix/*` branch to `main`. > Outside and first-time contributors also require an approving review from `SpicyMarinara`. <!-- See CONTRIBUTING.md § Branches. --> ## Linked issue Refs #7210, #7220 This is the follow-up promised in two CodeRabbit threads that were deferred so their PRs could land: - #7226 (trash busy status): [delete wording had no automated assertion](https://github.com/Pasta-Devs/Marinara-Engine/pull/7226#discussion_r4205157920) - #7229 (flaky trash test): [a failed lock release leaves the Message Trash hold behind](https://github.com/Pasta-Devs/Marinara-Engine/pull/7229#discussion_r4204966358) ## Why this change - **#7226** added a status line that says why trash rows pause: "Restoring messages…" or "Deleting messages…". Only the restore wording was checked by a test. The delete wording was checked by hand only, so a regression that showed the wrong text during a delete would pass CI. - **#7229** added `holdMessageTrash`, which lets parallel e2e runs share the global Message Trash switch. It saves this run's hold to `holders.json` before it removes its lock. If removing the lock fails, the helper rejects before it returns its release callback. The test calls the helper before its `try/finally`, so nothing ever releases that hold. Message Trash then stays on, and the holder count stays wrong, until the e2e servers restart. ## What changed Test-only. No app code, docs or CHANGELOG entry. - `e2e/message-trash-responsive.e2e.ts`: after the existing restore checks, the test empties the trash (Empty trash, then "Click again to empty") while `page.route` holds the `/trash/delete` request. It checks that the `role="status"` region reads "Deleting messages…" while the request is pending, and is empty again once it finishes. It also checks that exactly one `{ all: true }` delete was sent. The held request is released in `finally`, like the restore. Existing assertions are unchanged. - `e2e/message-marks-trash.e2e.ts`: `holdMessageTrash` now takes back its own hold if letting go of the lock fails after the hold was counted. The lock is still held at that point, so the helper decrements the holder count, restores the original settings if it was the last holder, writes the file and tries to remove the lock again. Other active holders keep their holds. It then rethrows the original error. If the rollback fails too, it throws an `AggregateError` with both errors. The lock-release steps and the release logic are now small shared helpers (`unlock`, `release`), so the normal release and the rollback use the same code. ## Validation - [ ] `pnpm check` passes locally - [ ] Container (Docker / Podman) built and ran without issue - [ ] Ran the app, clicked through the changes manually - [ ] Checked edge cases (light + dark mode, mobile viewport, empty states, error paths) - [ ] Above manual verification completed (describe below) - [ ] Read and followed `CONTRIBUTING.md` Agent-run evidence (local macOS, Playwright 1.63; the boxes above are left for the human reviewer): - `pnpm exec playwright test e2e/message-trash-responsive.e2e.ts e2e/message-marks-trash.e2e.ts --project=desktop-chromium --project=mobile-webkit --workers=1 --repeat-each=2`: 12 passed, on this branch rebased onto `staging` after #7226 and #7229 merged. - Mutation check for the delete status (temporary app change, reverted): `ChatTrashList` showed the restore wording for deletes too. The test failed on both projects at the new assertion: `Expected: "Deleting messages…"`, `Received: "Restoring messages…"`. - Rollback proof (temporary spec built from the helper's source, with lock removal set to reject once; deleted afterwards): - Lone holder: the hold rejects with the lock error, `holders.json` reads `{ holders: 0 }`, the lock is gone, and the feature settings equal the original. - With another active holder: that holder keeps its hold (`{ holders: 1, original }`), Message Trash stays on, and the lock is gone. Releasing the other holder then restores the original settings. - The same proof against the helper on `staging` fails: `holders.json` still reads `{ holders: 1, original: {} }` after the rejected hold. - `pnpm check` passed on the final commit. - Local CodeRabbit (`coderabbit review --agent --committed`) returned `rate_limit` (43 minutes) and did not review this commit. The GitHub CodeRabbit review has not run yet either. ### Manual verification notes - Manually run `pnpm regression:ui e2e/message-trash-responsive.e2e.ts --project=desktop-chromium --project=mobile-webkit --workers=1` and confirm both pass. - Manually run `pnpm regression:ui e2e/message-marks-trash.e2e.ts --project=mobile-webkit --project=mobile-chromium --repeat-each=2 --workers=4` and confirm no failures. - Manually check in the browser that emptying a large trash shows "Deleting messages…" over the dimmed rows, and that the line clears when it finishes. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README / CHANGELOG) as needed - [ ] Translated docs on the `docs-i18n` branch updated to match, or a `[docs-i18n]` follow-up issue opened (see CONTRIBUTING.md § Translated documentation) - [ ] Version/release files updated (only if this PR includes a version bump) ## UI evidence (if applicable) Not applicable: test-only change. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-24 04:06:04 +07:00
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#7638
No description provided.