[PR #7576] [MERGED] test(avatars): count only the mesh avatar's own pictures in the CSP e2e #7807

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

📋 Pull Request Information

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

Base: staging ← Head: feat/avatars-2d


📝 Commits (1)

  • 0744668 test(avatars): count only the mesh avatar's own pictures in the CSP e2e

📊 Changes

1 file changed (+11 additions, -7 deletions)

View changed files

📝 e2e/avatar-2d.e2e.ts (+11 -7)

📄 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 #7537 (lane: 2D, follow-up to #7549)

Why this change

  • The e2e test "mesh avatars load under the server's CSP and reuse their pictures when mounted again" (from #7549) failed at random: Expected: 15, Received: 25. Now that #7549 is on staging, the nightly full browser matrix can fail on it.
  • The cause is the test, not the renderer. Its probe counted every new Image() on the page. Professor Mari's home-screen sprites (/sprites/mari/basic/*.webp) sometimes load after the first count, so they were counted as mesh pictures. The mesh avatar's own pictures (blob: URLs) were reused across every remount, as intended.

What changed

  • e2e/avatar-2d.e2e.ts only. The probe now keeps each image made with new Image(), and the CSP test counts only those whose src is a blob: URL. mesh-avatar loads an archive's pictures that way, and the home screen never does. No app code changes.
  • The check still bites: with the renderer's per-owner file cache turned off (so each mount opens the archive again), the fixed test fails with Expected: 13, Received: 52.

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

Commands run by the agent on 07446689a (results as reported, not ticked):

  • Before the fix, on staging 185fc5d99: playwright test --project=desktop-chromium e2e/avatar-2d.e2e.ts --grep "reuse their pictures" --repeat-each=3 gave 1 failed and 2 passed (Expected: 15, Received: 25).
  • After the fix, the same test with --repeat-each=8 on desktop-chromium: 8 passed.
  • --project=mobile-chromium --project=mobile-webkit --repeat-each=3: 6 passed.
  • The whole e2e/avatar-2d.e2e.ts file on desktop-chromium: 9 passed.
  • Mutation check: the per-owner file cache in mesh-avatar-renderer.ts was turned off temporarily, and the fixed test failed with Expected: 13, Received: 52. The change was reverted.
  • pnpm check: exit 0. The only lint warning is the existing one in HomeProfessorMariChat.tsx.
  • pnpm check:e2e-types and prettier --check e2e/avatar-2d.e2e.ts: pass.
  • CodeRabbit was not rerun locally for this test-only change.

Manual verification notes

  • Nothing to check by hand, because only a test changes. Optionally, run pnpm exec playwright test -c playwright.config.ts --project=desktop-chromium e2e/avatar-2d.e2e.ts --grep "reuse their pictures" --repeat-each=5 and confirm every run passes.

Docs and release impact

  • No docs changes needed
  • Updated docs (README / CONTRIBUTING / android/README) 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: no UI change.

Summary by CodeRabbit

  • Tests
    • Updated the picture-loading check to count only recorded images loaded from blob URLs, improving coverage of loading and reuse across mounts.

🔄 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/7576 **Author:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Created:** 10/13/2026 **Status:** ✅ Merged **Merged:** 10/13/2026 **Merged by:** [@SpicyMarinara](https://github.com/SpicyMarinara) **Base:** `staging` ← **Head:** `feat/avatars-2d` --- ### 📝 Commits (1) - [`0744668`](https://github.com/Pasta-Devs/Marinara-Engine/commit/07446689a072f4dc8df2423e070ef6ef8f5d9b67) test(avatars): count only the mesh avatar's own pictures in the CSP e2e ### 📊 Changes **1 file changed** (+11 additions, -7 deletions) <details> <summary>View changed files</summary> 📝 `e2e/avatar-2d.e2e.ts` (+11 -7) </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`. ## Linked issue Refs #7537 (lane: 2D, follow-up to #7549) ## Why this change - The e2e test "mesh avatars load under the server's CSP and reuse their pictures when mounted again" (from #7549) failed at random: `Expected: 15, Received: 25`. Now that #7549 is on `staging`, the nightly full browser matrix can fail on it. - The cause is the test, not the renderer. Its probe counted every `new Image()` on the page. Professor Mari's home-screen sprites (`/sprites/mari/basic/*.webp`) sometimes load after the first count, so they were counted as mesh pictures. The mesh avatar's own pictures (blob: URLs) were reused across every remount, as intended. ## What changed - `e2e/avatar-2d.e2e.ts` only. The probe now keeps each image made with `new Image()`, and the CSP test counts only those whose `src` is a `blob:` URL. mesh-avatar loads an archive's pictures that way, and the home screen never does. No app code changes. - The check still bites: with the renderer's per-owner file cache turned off (so each mount opens the archive again), the fixed test fails with `Expected: 13, Received: 52`. ## 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` Commands run by the agent on 07446689a (results as reported, not ticked): - Before the fix, on `staging` 185fc5d99: `playwright test --project=desktop-chromium e2e/avatar-2d.e2e.ts --grep "reuse their pictures" --repeat-each=3` gave 1 failed and 2 passed (`Expected: 15, Received: 25`). - After the fix, the same test with `--repeat-each=8` on desktop-chromium: 8 passed. - `--project=mobile-chromium --project=mobile-webkit --repeat-each=3`: 6 passed. - The whole `e2e/avatar-2d.e2e.ts` file on desktop-chromium: 9 passed. - Mutation check: the per-owner file cache in `mesh-avatar-renderer.ts` was turned off temporarily, and the fixed test failed with `Expected: 13, Received: 52`. The change was reverted. - `pnpm check`: exit 0. The only lint warning is the existing one in `HomeProfessorMariChat.tsx`. - `pnpm check:e2e-types` and `prettier --check e2e/avatar-2d.e2e.ts`: pass. - CodeRabbit was not rerun locally for this test-only change. ### Manual verification notes - Nothing to check by hand, because only a test changes. Optionally, run `pnpm exec playwright test -c playwright.config.ts --project=desktop-chromium e2e/avatar-2d.e2e.ts --grep "reuse their pictures" --repeat-each=5` and confirm every run passes. ## Docs and release impact - [ ] No docs changes needed - [ ] Updated docs (README / CONTRIBUTING / android/README) 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: no UI change. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Tests** * Updated the picture-loading check to count only recorded images loaded from blob URLs, improving coverage of loading and reuse across mounts. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-24 04:07:40 +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#7807
No description provided.