[PR #2344] [MERGED] Fix chat validation parity #5546

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

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/2344
Author: @Promansis
Created: 6/5/2026
Status: ✅ Merged
Merged: 6/5/2026
Merged by: @Promansis

Base: refactor ← Head: fix/issue-2275


📝 Commits (1)

  • 04054c6 Fix chat validation parity

📊 Changes

6 files changed (+337 additions, -15 deletions)

View changed files

📝 src-tauri/src/commands/storage/chats.rs (+38 -3)
📝 src-tauri/src/commands/storage/commands/entities.rs (+228 -2)
📝 src-tauri/src/commands/storage/integrations.rs (+4 -0)
📝 src-tauri/src/commands/storage/integrations/discord.rs (+1 -1)
📝 src/features/catalog/chats/hooks/use-chats.ts (+17 -4)
📝 src/shared/api/storage-api.ts (+49 -5)

📄 Description

Linked issue

Closes #2275

Why this change

09-CHAT-ERROR-chat-message-validation had parity gaps where refactor accepted chat metadata and bulk message payloads that legacy rejected or normalized.

What changed

  • Reject invalid Discord webhook URLs on chat metadata writes.
  • Require inactiveCharacterIds to be an array of strings and normalize it to IDs present in the chat.
  • Reject empty, blank-only, or invalid bulk message delete payloads instead of returning successful no-ops.
  • Reject empty bulk hidden-message updates in the shared chat hook before optimistic cache changes.

Refactor impact

Primary owner:

Rust storage, shared API, shared chat catalog hooks

Impact areas reviewed:

  • Chat metadata durable write path
  • Bulk message delete command
  • Shared chat hook optimistic updates
  • Embedded and hostable invoke path through shared storage_update

Boundary notes:

  • Validation sits at the durable Rust storage update boundary for raw storage_update callers.
  • src/shared/api/storage-api.ts mirrors the user-facing validation before crossing the runtime adapter.
  • No engine imports from React, Tauri, or feature internals were added.

Pressure points touched:

  • src-tauri/src/commands/storage/commands/entities.rs
  • src-tauri/src/commands/storage/chats.rs
  • src/shared/api/storage-api.ts
  • src/features/catalog/chats/hooks/use-chats.ts

Validation

  • Matching validation command passes locally (for example pnpm typecheck, pnpm build, pnpm check:architecture, pnpm check:docs, or full pnpm check when warranted)
  • Full pnpm check passes before PR push/handoff
  • Human/manual validation completed by contributor or reviewer

Manual verification notes

  • cargo test --manifest-path src-tauri/Cargo.toml chat_metadata_patch
  • cargo test --manifest-path src-tauri/Cargo.toml bulk_delete_messages_rejects_empty_or_invalid_id_payloads
  • cargo check --manifest-path src-tauri/Cargo.toml
  • pnpm typecheck
  • git diff --check
  • pnpm check

Feature Discoverability

Check exactly one:

  • Updated src/features/shell/discovery/ because this PR adds or materially changes a user-discoverable feature, workflow, setting, mode, panel, import path, agent, media capability, or advanced tool.
  • N/A because this PR is only a bugfix, refactor, test, docs, internal wiring, visual polish, copy edit, or compatibility fix and does not add a new thing users need to find.

Reason:

Validation parity fix only; no new user-discoverable surface.

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

UI evidence

No visible UI changes; validation/storage behavior only.


🔄 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/2344 **Author:** [@Promansis](https://github.com/Promansis) **Created:** 6/5/2026 **Status:** ✅ Merged **Merged:** 6/5/2026 **Merged by:** [@Promansis](https://github.com/Promansis) **Base:** `refactor` ← **Head:** `fix/issue-2275` --- ### 📝 Commits (1) - [`04054c6`](https://github.com/Pasta-Devs/Marinara-Engine/commit/04054c6c5f19b27498a19d7991ff111d034a89ca) Fix chat validation parity ### 📊 Changes **6 files changed** (+337 additions, -15 deletions) <details> <summary>View changed files</summary> 📝 `src-tauri/src/commands/storage/chats.rs` (+38 -3) 📝 `src-tauri/src/commands/storage/commands/entities.rs` (+228 -2) 📝 `src-tauri/src/commands/storage/integrations.rs` (+4 -0) 📝 `src-tauri/src/commands/storage/integrations/discord.rs` (+1 -1) 📝 `src/features/catalog/chats/hooks/use-chats.ts` (+17 -4) 📝 `src/shared/api/storage-api.ts` (+49 -5) </details> ### 📄 Description ## Linked issue Closes #2275 ## Why this change `09-CHAT-ERROR-chat-message-validation` had parity gaps where refactor accepted chat metadata and bulk message payloads that legacy rejected or normalized. ## What changed - Reject invalid Discord webhook URLs on chat metadata writes. - Require `inactiveCharacterIds` to be an array of strings and normalize it to IDs present in the chat. - Reject empty, blank-only, or invalid bulk message delete payloads instead of returning successful no-ops. - Reject empty bulk hidden-message updates in the shared chat hook before optimistic cache changes. ## Refactor impact Primary owner: Rust storage, shared API, shared chat catalog hooks Impact areas reviewed: - Chat metadata durable write path - Bulk message delete command - Shared chat hook optimistic updates - Embedded and hostable invoke path through shared `storage_update` Boundary notes: - Validation sits at the durable Rust storage update boundary for raw `storage_update` callers. - `src/shared/api/storage-api.ts` mirrors the user-facing validation before crossing the runtime adapter. - No engine imports from React, Tauri, or feature internals were added. Pressure points touched: - `src-tauri/src/commands/storage/commands/entities.rs` - `src-tauri/src/commands/storage/chats.rs` - `src/shared/api/storage-api.ts` - `src/features/catalog/chats/hooks/use-chats.ts` ## Validation - [x] Matching validation command passes locally (for example `pnpm typecheck`, `pnpm build`, `pnpm check:architecture`, `pnpm check:docs`, or full `pnpm check` when warranted) - [x] Full `pnpm check` passes before PR push/handoff - [ ] Human/manual validation completed by contributor or reviewer ### Manual verification notes - `cargo test --manifest-path src-tauri/Cargo.toml chat_metadata_patch` - `cargo test --manifest-path src-tauri/Cargo.toml bulk_delete_messages_rejects_empty_or_invalid_id_payloads` - `cargo check --manifest-path src-tauri/Cargo.toml` - `pnpm typecheck` - `git diff --check` - `pnpm check` ## Feature Discoverability Check exactly one: - [ ] Updated `src/features/shell/discovery/` because this PR adds or materially changes a user-discoverable feature, workflow, setting, mode, panel, import path, agent, media capability, or advanced tool. - [x] N/A because this PR is only a bugfix, refactor, test, docs, internal wiring, visual polish, copy edit, or compatibility fix and does not add a new thing users need to find. Reason: Validation parity fix only; no new user-discoverable surface. ## Docs and release impact - [x] No docs changes needed - [ ] Updated `README.md` - [ ] Updated `CONTRIBUTING.md` - [ ] Updated `docs/developer/` - [ ] Updated repo skills or `AGENTS.md` - [x] Confirmed this PR does not restore old staging/package-workspace/release claims ## UI evidence No visible UI changes; validation/storage behavior only. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:17:15 +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#5546
No description provided.