[PR #2345] [MERGED] Run ST bulk import stream on blocking pool #5547

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/2345
Author: @Xelvanis
Created: 6/5/2026
Status: ✅ Merged
Merged: 6/5/2026
Merged by: @Xelvanis

Base: refactor ← Head: fix/st-bulk-import-spawn-blocking


📝 Commits (1)

  • ab54595 Fix ST bulk import stream and module state

📊 Changes

6 files changed (+31 additions, -14 deletions)

View changed files

📝 src-tauri/src/http_server.rs (+16 -4)
📝 src/features/shell/plugins/components/CoreModulesSettings.tsx (+10 -4)
📝 src/features/shell/plugins/hooks/use-core-modules.ts (+3 -4)
➕ src/features/shell/plugins/settings.ts (+1 -0)
📝 src/features/shell/plugins/shell.ts (+0 -1)
📝 src/features/shell/settings/components/SettingsPanel.tsx (+1 -1)

📄 Description

Linked issue

Closes #2331

Why this change

  • The server-runtime ST bulk import SSE route ran synchronous import work on a Tokio async worker, which could starve concurrent server requests during large imports.
  • The current Settings surface still has a discoverable Plugins/Core Modules entrypoint, so the PR keeps that surface attached while making its loading/error state explicit.

What changed

  • Moved the synchronous ST bulk import callback into tokio::task::spawn_blocking.
  • Kept SSE progress/error forwarding through the existing unbounded channel.
  • Added a join-error mapping for failed blocking tasks.
  • Kept core module settings attached through a focused plugins/settings entrypoint.
  • Changed core module settings UI so loading/error states do not render fallback module cards as persisted state.
  • Seeded the core module settings query cache from successful toggle mutations before invalidating/refetching.

Refactor impact

Primary owner:

Rust remote runtime HTTP route / imports; shell plugin settings

Impact areas reviewed:

  • /api/import/st-bulk/run SSE route
  • ST bulk import callback progress, done, and error event contract
  • Sibling profile import streaming route pattern
  • Core module settings loading, error, and mutation state

Boundary notes:

  • Dedicated src-tauri/src/http_server.rs route for the import fix.
  • Shell settings import core module settings through the focused src/features/shell/plugins/settings.ts entrypoint.
  • No engine, shared API, command registration, or import service behavior changed.
  • Remote-capable behavior stays inside the existing Rust HTTP/import pipeline.

Pressure points touched:

  • src-tauri/src/http_server.rs dedicated streaming route.

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 fmt --manifest-path src-tauri/Cargo.toml
  • cargo check --manifest-path src-tauri/Cargo.toml
  • git diff --check
  • pnpm check:unused
  • pnpm typecheck
  • pnpm check
  • Static review verified the core module settings UI now renders loading/error bodies without fallback module cards.
  • Live large ST bulk import concurrency test was not run.

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:

  • Keeps the existing Discover entrypoint and settings surface wired; does not add a new discoverable feature.

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

N/A. No new visible layout changes beyond preserving the existing core module settings surface and clarifying loading/error content.


🔄 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/2345 **Author:** [@Xelvanis](https://github.com/Xelvanis) **Created:** 6/5/2026 **Status:** ✅ Merged **Merged:** 6/5/2026 **Merged by:** [@Xelvanis](https://github.com/Xelvanis) **Base:** `refactor` ← **Head:** `fix/st-bulk-import-spawn-blocking` --- ### 📝 Commits (1) - [`ab54595`](https://github.com/Pasta-Devs/Marinara-Engine/commit/ab54595a31de5f179cc8b189e3cee1b2ccf65e7d) Fix ST bulk import stream and module state ### 📊 Changes **6 files changed** (+31 additions, -14 deletions) <details> <summary>View changed files</summary> 📝 `src-tauri/src/http_server.rs` (+16 -4) 📝 `src/features/shell/plugins/components/CoreModulesSettings.tsx` (+10 -4) 📝 `src/features/shell/plugins/hooks/use-core-modules.ts` (+3 -4) ➕ `src/features/shell/plugins/settings.ts` (+1 -0) 📝 `src/features/shell/plugins/shell.ts` (+0 -1) 📝 `src/features/shell/settings/components/SettingsPanel.tsx` (+1 -1) </details> ### 📄 Description ## Linked issue Closes #2331 ## Why this change - The server-runtime ST bulk import SSE route ran synchronous import work on a Tokio async worker, which could starve concurrent server requests during large imports. - The current Settings surface still has a discoverable Plugins/Core Modules entrypoint, so the PR keeps that surface attached while making its loading/error state explicit. ## What changed - Moved the synchronous ST bulk import callback into `tokio::task::spawn_blocking`. - Kept SSE progress/error forwarding through the existing unbounded channel. - Added a join-error mapping for failed blocking tasks. - Kept core module settings attached through a focused `plugins/settings` entrypoint. - Changed core module settings UI so loading/error states do not render fallback module cards as persisted state. - Seeded the core module settings query cache from successful toggle mutations before invalidating/refetching. ## Refactor impact Primary owner: Rust remote runtime HTTP route / imports; shell plugin settings Impact areas reviewed: - `/api/import/st-bulk/run` SSE route - ST bulk import callback progress, done, and error event contract - Sibling profile import streaming route pattern - Core module settings loading, error, and mutation state Boundary notes: - Dedicated `src-tauri/src/http_server.rs` route for the import fix. - Shell settings import core module settings through the focused `src/features/shell/plugins/settings.ts` entrypoint. - No engine, shared API, command registration, or import service behavior changed. - Remote-capable behavior stays inside the existing Rust HTTP/import pipeline. Pressure points touched: - `src-tauri/src/http_server.rs` dedicated streaming route. ## 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 fmt --manifest-path src-tauri/Cargo.toml` - `cargo check --manifest-path src-tauri/Cargo.toml` - `git diff --check` - `pnpm check:unused` - `pnpm typecheck` - `pnpm check` - Static review verified the core module settings UI now renders loading/error bodies without fallback module cards. - Live large ST bulk import concurrency test was not run. ## 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: - Keeps the existing Discover entrypoint and settings surface wired; does not add a new discoverable feature. ## 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 N/A. No new visible layout changes beyond preserving the existing core module settings surface and clarifying loading/error content. --- <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#5547
No description provided.