[PR #1450] [CLOSED] game: ignore blank turn sends #5091

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/1450
Author: @Promansis
Created: 5/28/2026
Status: ❌ Closed

Base: refactor ← Head: fix/issue-1449


📝 Commits (1)

  • 8767791 game: ignore blank turn sends

📊 Changes

4 files changed (+99 additions, -2 deletions)

View changed files

📝 src/engine/generation/start-generation.ts (+1 -1)
➕ src/engine/modes/game/turn/game-turn.service.test.ts (+86 -0)
📝 src/engine/modes/game/turn/game-turn.service.ts (+11 -1)
📝 src/features/modes/game/components/GameSurface.tsx (+1 -0)

📄 Description

Linked issue

Closes #1449

Why this change

Whitespace-only input in Game mode could reach the Game turn generation path and create persisted messages instead of behaving like an empty send.

What changed

  • Added a Game turn engine guard that no-ops explicit blank player turns before storage/model work.
  • Added a GameSurface callback guard so blank sends do not commit interrupt/map side effects.
  • Added focused Game turn tests for whitespace-only, passive no-message, and attachment-only turn behavior.
  • Refreshed Graphify output after the code change.

Refactor impact

Primary owner:

Game mode / game turn engine.

Impact areas reviewed:

  • Game mode send flow.
  • Engine generation entrypoint for Game turns.
  • Attachment-only Game turns.
  • Passive Game turn retry/continue path with omitted user message.

Boundary notes:

  • Engine stays React-free.
  • Feature UI only adds a mode-owned callback guard.
  • No shared API, Rust, or remote-runtime routing changes.

Pressure points touched:

  • GameSurface.
  • Game turn generation service.

Validation

  • pnpm check passes locally
  • pnpm typecheck passes locally
  • pnpm build passes locally
  • pnpm check:architecture passes locally
  • pnpm check:docs passes locally
  • cargo check --manifest-path src-tauri/Cargo.toml --workspace passes locally
  • Rust clippy/tests were run for Rust behavior changes
  • Browser or Tauri app manual verification completed
  • Playwright, screenshot, or recording evidence added for UI changes
  • Remote runtime smoke checked when relevant

Manual verification notes

  • Ran pnpm test -- src/engine/modes/game/turn/game-turn.service.test.ts; Vitest completed with 44 files / 267 tests passing under repo config.
  • Ran graphify update . after code changes.
  • No browser/manual runtime pass was performed.

Docs and release impact

  • No docs changes needed
  • Updated README.md
  • Updated CONTRIBUTING.md
  • Updated docs/developer/
  • Updated repo skills or AGENTS.md
  • Confirmed this PR does not restore old staging/package-workspace/release claims

No docs changes needed for this narrow bug fix; repo guidance unchanged.

UI evidence

No screenshots or recordings attached. Unit coverage proves the core no-persist/no-model path for explicit whitespace-only Game turns.

Summary by CodeRabbit

Release Notes

  • Bug Fixes

    • Empty or whitespace-only game turns are now prevented from being submitted, preventing unnecessary processing.
    • Game turns cannot be sent without either message content or attachments, ensuring all submissions are meaningful.
  • Tests

    • Added comprehensive test suite covering game turn submission validation for empty messages, whitespace-only messages, and attachment-only scenarios.

Review Change Stack


🔄 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/1450 **Author:** [@Promansis](https://github.com/Promansis) **Created:** 5/28/2026 **Status:** ❌ Closed **Base:** `refactor` ← **Head:** `fix/issue-1449` --- ### 📝 Commits (1) - [`8767791`](https://github.com/Pasta-Devs/Marinara-Engine/commit/8767791b6e348a75d6d77ce1ed38db4be33e40a0) game: ignore blank turn sends ### 📊 Changes **4 files changed** (+99 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `src/engine/generation/start-generation.ts` (+1 -1) ➕ `src/engine/modes/game/turn/game-turn.service.test.ts` (+86 -0) 📝 `src/engine/modes/game/turn/game-turn.service.ts` (+11 -1) 📝 `src/features/modes/game/components/GameSurface.tsx` (+1 -0) </details> ### 📄 Description ## Linked issue Closes #1449 ## Why this change Whitespace-only input in Game mode could reach the Game turn generation path and create persisted messages instead of behaving like an empty send. ## What changed - Added a Game turn engine guard that no-ops explicit blank player turns before storage/model work. - Added a GameSurface callback guard so blank sends do not commit interrupt/map side effects. - Added focused Game turn tests for whitespace-only, passive no-message, and attachment-only turn behavior. - Refreshed Graphify output after the code change. ## Refactor impact Primary owner: Game mode / game turn engine. Impact areas reviewed: - Game mode send flow. - Engine generation entrypoint for Game turns. - Attachment-only Game turns. - Passive Game turn retry/continue path with omitted user message. Boundary notes: - Engine stays React-free. - Feature UI only adds a mode-owned callback guard. - No shared API, Rust, or remote-runtime routing changes. Pressure points touched: - GameSurface. - Game turn generation service. ## Validation - [x] `pnpm check` passes locally - [x] `pnpm typecheck` passes locally - [x] `pnpm build` passes locally - [x] `pnpm check:architecture` passes locally - [x] `pnpm check:docs` passes locally - [x] `cargo check --manifest-path src-tauri/Cargo.toml --workspace` passes locally - [x] Rust clippy/tests were run for Rust behavior changes - [ ] Browser or Tauri app manual verification completed - [ ] Playwright, screenshot, or recording evidence added for UI changes - [x] Remote runtime smoke checked when relevant ### Manual verification notes - Ran `pnpm test -- src/engine/modes/game/turn/game-turn.service.test.ts`; Vitest completed with 44 files / 267 tests passing under repo config. - Ran `graphify update .` after code changes. - No browser/manual runtime pass was performed. ## Docs and release impact - [x] No docs changes needed - [ ] Updated `README.md` - [ ] Updated `CONTRIBUTING.md` - [ ] Updated `docs/developer/` - [ ] Updated repo skills or `AGENTS.md` - [ ] Confirmed this PR does not restore old staging/package-workspace/release claims No docs changes needed for this narrow bug fix; repo guidance unchanged. ## UI evidence No screenshots or recordings attached. Unit coverage proves the core no-persist/no-model path for explicit whitespace-only Game turns. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## Release Notes * **Bug Fixes** * Empty or whitespace-only game turns are now prevented from being submitted, preventing unnecessary processing. * Game turns cannot be sent without either message content or attachments, ensuring all submissions are meaningful. * **Tests** * Added comprehensive test suite covering game turn submission validation for empty messages, whitespace-only messages, and attachment-only scenarios. <!-- review_stack_entry_start --> [![Review Change Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/Pasta-Devs/Marinara-Engine/pull/1450?utm_source=github_walkthrough&utm_medium=github&utm_campaign=change_stack) <!-- review_stack_entry_end --> <!-- 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-22 04:13:10 +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#5091
No description provided.