[GH-ISSUE #2112] [Issue]: Restore Google Fonts download safety parity #1033

Closed
opened 2026-10-21 05:25:23 +07:00 by bsakaguchi · 0 comments
Owner

Originally created by @Promansis on GitHub (Jun 4, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2112

Originally assigned to: @Promansis on GitHub.

Summary

Target 4 catalog media edge parityscan found a font-file parity gap on refactor: custom fonts are listed, served, registered, and downloadable, but Google Fonts downloads lost legacy safety behavior around concurrent requests, CSS endpoint fallback, and atomic replacement.

Expected behavior

The refactor branch should preserve the legacy Google Fonts safeguards from main:

  • Prevent duplicate concurrent downloads of the same family.
  • Query both the modern CSS2 endpoint and the legacy CSS endpoint, preferring the richer shard list when needed.
  • Replace managed Google font shards atomically, with rollback if a write/rename/metadata update fails.

Actual behavior

Current refactor core font behavior exists, but the download path directly fetches the CSS2 endpoint and writes downloaded .woff2 files plus metadata without the legacy concurrent-download guard, legacy endpoint fallback, or atomic replace/rollback flow.

Steps to reproduce

  1. Compare main:packages/server/src/routes/fonts.routes.ts with refactor:src-tauri/src/commands/storage/fonts.rs.
  2. In legacy, inspect downloadingFonts, loadGoogleFontFaces, and replaceManagedGoogleFontFiles.
  3. In refactor, inspect download_google_font, fetch_google_font_faces, and direct fs::write / metadata writes.

Impact area

  • App shell, navigation, startup, or providers
  • Catalog resources
  • Chat mode
  • Roleplay mode
  • Game mode
  • Shared mode UI
  • Runtime systems: generation, world-state, visuals, tracker, or haptics
  • Professor Mari or shell tools
  • React-free engine behavior, contracts, agents, or capability ports
  • Shared API wrapper or remote runtime routing
  • Tauri/Rust storage, assets, LLM, integrations, security, imports, or HTTP runtime
  • Docs, contributor workflow, or templates

Environment

  • Branch or commit: refactor, parityscan on 2026-06-04
  • Run mode: Tauri desktop / remote runtime relevant
  • OS + version: not app-proven
  • Node + pnpm versions: not relevant
  • Rust version, if relevant: not recorded
  • Remote Runtime URL configured? not relevant
  • Provider, model, or integration, if relevant: Google Fonts

Logs, screenshots, or video

No app logs or screenshots. Static parity evidence:

  • Legacy route: main:packages/server/src/routes/fonts.routes.ts
  • Refactor route: src-tauri/src/commands/storage/fonts.rs
  • Refactor wrapper/app registration: src/shared/api/settings-assets-api.ts, src/app/App.tsx
  • Target tracker: #2106, Catalog Media Edges Rescan 2026-06-04

Verification from parityscan:

  • cargo test --manifest-path src-tauri/Cargo.toml font matched 0 tests.

Regression notes

Worked better on main: legacy had downloadingFonts, CSS2 plus legacy CSS probing, and atomic managed-file replacement with rollback. Refactor has the core workflow but not these safety edges.

Additional context

This is not a request for new font features. It is a parity gap from target 4 media/assets scanning. Restore the legacy safety behavior in the Rust/Tauri font owner without broadening feature-level raw Tauri calls.

Template check

Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked:

  • I DID NOT read this template and provide the requested details.
Originally created by @Promansis on GitHub (Jun 4, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/2112 Originally assigned to: @Promansis on GitHub. ## Summary Target 4 catalog media edge parityscan found a font-file parity gap on `refactor`: custom fonts are listed, served, registered, and downloadable, but Google Fonts downloads lost legacy safety behavior around concurrent requests, CSS endpoint fallback, and atomic replacement. ## Expected behavior The refactor branch should preserve the legacy Google Fonts safeguards from `main`: - Prevent duplicate concurrent downloads of the same family. - Query both the modern CSS2 endpoint and the legacy CSS endpoint, preferring the richer shard list when needed. - Replace managed Google font shards atomically, with rollback if a write/rename/metadata update fails. ## Actual behavior Current refactor core font behavior exists, but the download path directly fetches the CSS2 endpoint and writes downloaded `.woff2` files plus metadata without the legacy concurrent-download guard, legacy endpoint fallback, or atomic replace/rollback flow. ## Steps to reproduce 1. Compare `main:packages/server/src/routes/fonts.routes.ts` with `refactor:src-tauri/src/commands/storage/fonts.rs`. 2. In legacy, inspect `downloadingFonts`, `loadGoogleFontFaces`, and `replaceManagedGoogleFontFiles`. 3. In refactor, inspect `download_google_font`, `fetch_google_font_faces`, and direct `fs::write` / metadata writes. ## Impact area - [ ] App shell, navigation, startup, or providers - [x] Catalog resources - [ ] Chat mode - [ ] Roleplay mode - [ ] Game mode - [ ] Shared mode UI - [ ] Runtime systems: generation, world-state, visuals, tracker, or haptics - [ ] Professor Mari or shell tools - [ ] React-free engine behavior, contracts, agents, or capability ports - [x] Shared API wrapper or remote runtime routing - [x] Tauri/Rust storage, assets, LLM, integrations, security, imports, or HTTP runtime - [ ] Docs, contributor workflow, or templates ## Environment - Branch or commit: `refactor`, parityscan on 2026-06-04 - Run mode: Tauri desktop / remote runtime relevant - OS + version: not app-proven - Node + pnpm versions: not relevant - Rust version, if relevant: not recorded - Remote Runtime URL configured? not relevant - Provider, model, or integration, if relevant: Google Fonts ## Logs, screenshots, or video No app logs or screenshots. Static parity evidence: - Legacy route: `main:packages/server/src/routes/fonts.routes.ts` - Refactor route: `src-tauri/src/commands/storage/fonts.rs` - Refactor wrapper/app registration: `src/shared/api/settings-assets-api.ts`, `src/app/App.tsx` - Target tracker: #2106, Catalog Media Edges Rescan 2026-06-04 Verification from parityscan: - `cargo test --manifest-path src-tauri/Cargo.toml font` matched 0 tests. ## Regression notes Worked better on `main`: legacy had `downloadingFonts`, CSS2 plus legacy CSS probing, and atomic managed-file replacement with rollback. Refactor has the core workflow but not these safety edges. ## Additional context This is not a request for new font features. It is a parity gap from target 4 media/assets scanning. Restore the legacy safety behavior in the Rust/Tauri font owner without broadening feature-level raw Tauri calls. ## Template check Please uncheck the box below before submitting so we know you read the template. It is intentionally pre-checked: - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-21 05:25:23 +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#1033
No description provided.