[PR #2123] [MERGED] Restore Google Fonts download safety parity #5449

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

📋 Pull Request Information

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

Base: refactor ← Head: fix/google-font-download-safety-parity


📝 Commits (2)

  • 632afe3 Restore Google Fonts download safety parity
  • 1731b9a Preserve Google Font lookup transport errors

📊 Changes

1 file changed (+605 additions, -58 deletions)

View changed files

📝 src-tauri/src/commands/storage/fonts.rs (+605 -58)

📄 Description

Linked issue

Closes #2112

Why this change

  • Restores legacy Google Fonts download safeguards that were missing on the refactor Rust storage path: duplicate in-flight download protection, CSS endpoint fallback/richer shard selection, and atomic managed shard replacement.

What changed

  • Added a per-family in-memory Google Fonts download guard in the Rust fonts command.
  • Fetches both the CSS2 and legacy Google Fonts CSS endpoints, then uses whichever returns the richer face/shard list.
  • Downloads and validates all target .woff2 shards before replacing existing managed Google font files.
  • Replaces managed Google font shards through temp files and backups, with rollback on install or metadata failures.
  • Writes font metadata through a temp file replacement path instead of direct writes.

Refactor impact

Primary owner:

Rust storage

Impact areas reviewed:

  • Catalog media/settings asset font download path
  • Embedded Tauri command path
  • Remote runtime command allowlist and HTTP dispatch path

Boundary notes:

  • Behavior remains inside src-tauri/src/commands/storage/fonts.rs.
  • src/shared/api/settings-assets-api.ts, src/shared/api/remote-runtime.ts, and src-tauri/src/http_dispatch.rs already route fonts_google_download explicitly; no feature-layer raw runtime calls were added.
  • No React, engine, or shared API contract shape changes.

Pressure points touched:

  • None. No ModeSurface, GameSurface, shared mode UI, command registration, or import modules changed.

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 check --manifest-path src-tauri/Cargo.toml
  • pnpm check
  • Static parity comparison against upstream/main:packages/server/src/routes/fonts.routes.ts for downloadingFonts, loadGoogleFontFaces, and replaceManagedGoogleFontFiles.
  • No manual app download against live Google Fonts was performed.

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:

  • Bugfix only; it restores existing Google Fonts download safety behavior.

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

  • Not applicable; no visible UI changes.

🔄 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/2123 **Author:** [@Promansis](https://github.com/Promansis) **Created:** 6/4/2026 **Status:** ✅ Merged **Merged:** 6/4/2026 **Merged by:** [@Promansis](https://github.com/Promansis) **Base:** `refactor` ← **Head:** `fix/google-font-download-safety-parity` --- ### 📝 Commits (2) - [`632afe3`](https://github.com/Pasta-Devs/Marinara-Engine/commit/632afe30ae198a6922b785a2784e1790320f2c7b) Restore Google Fonts download safety parity - [`1731b9a`](https://github.com/Pasta-Devs/Marinara-Engine/commit/1731b9a18eeecdce285b89fb8c43c34cfd0ed3f1) Preserve Google Font lookup transport errors ### 📊 Changes **1 file changed** (+605 additions, -58 deletions) <details> <summary>View changed files</summary> 📝 `src-tauri/src/commands/storage/fonts.rs` (+605 -58) </details> ### 📄 Description ## Linked issue Closes #2112 ## Why this change - Restores legacy Google Fonts download safeguards that were missing on the refactor Rust storage path: duplicate in-flight download protection, CSS endpoint fallback/richer shard selection, and atomic managed shard replacement. ## What changed - Added a per-family in-memory Google Fonts download guard in the Rust fonts command. - Fetches both the CSS2 and legacy Google Fonts CSS endpoints, then uses whichever returns the richer face/shard list. - Downloads and validates all target `.woff2` shards before replacing existing managed Google font files. - Replaces managed Google font shards through temp files and backups, with rollback on install or metadata failures. - Writes font metadata through a temp file replacement path instead of direct writes. ## Refactor impact Primary owner: Rust storage Impact areas reviewed: - Catalog media/settings asset font download path - Embedded Tauri command path - Remote runtime command allowlist and HTTP dispatch path Boundary notes: - Behavior remains inside `src-tauri/src/commands/storage/fonts.rs`. - `src/shared/api/settings-assets-api.ts`, `src/shared/api/remote-runtime.ts`, and `src-tauri/src/http_dispatch.rs` already route `fonts_google_download` explicitly; no feature-layer raw runtime calls were added. - No React, engine, or shared API contract shape changes. Pressure points touched: - None. No `ModeSurface`, `GameSurface`, shared mode UI, command registration, or import modules changed. ## 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 check --manifest-path src-tauri/Cargo.toml` - `pnpm check` - Static parity comparison against `upstream/main:packages/server/src/routes/fonts.routes.ts` for `downloadingFonts`, `loadGoogleFontFaces`, and `replaceManagedGoogleFontFiles`. - No manual app download against live Google Fonts was performed. ## 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: - Bugfix only; it restores existing Google Fonts download safety behavior. ## 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 ## UI evidence - Not applicable; no visible UI changes. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:16:25 +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#5449
No description provided.