[GH-ISSUE #3787] [Issue]: Serialize browser updates and preserve the exact recovery stash #2043

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

Originally created by @Xelvanis on GitHub (Jul 18, 2026).
Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/3787

Summary

Browser-applied Git updates are not serialized server-side, and stash recovery is not tied to the exact stash created by the updater. Overlapping callers or a stash-apply conflict can leave the checkout ambiguous or conflicted before dependency installation and build steps run.

Expected behavior

Only one browser update should run per server process. The updater should capture its exact recovery stash, preserve it if restoration conflicts, clean and restore the original checkout after movement failures, and stop before installation unless Git reaches the confirmed target commit cleanly.

Actual behavior

The route relies on client-side button state rather than a server lock. It uses the current stash stack for restoration and suppresses stash failures, so another tab/API client or an intervening Git stash can race the update and recovery sequence.

Steps to reproduce

This is a destructive source-audit scenario. Use a disposable Git clone, not a valuable installation.

  1. Start a Git-based Marinara source install with tracked local changes.
  2. Submit overlapping POST /api/updates/apply requests from separate tabs or API clients, or arrange for the updater stash to conflict when reapplied.
  3. Observe that the Git, stash, install, and build operations are not server-serialized and stash restoration failures do not prevent the later update steps.

Environment

  • Marinara Engine version: 2.3.3
  • Install type: source / Git
  • OS + version: Microsoft Windows 11 Pro 10.0.26200; route behavior is platform-independent
  • Browser or app shell: browser settings panel or direct API client

Logs, screenshots, or video

No production incident log. The failure paths were identified through code audit and exercised with disposable Git fixtures and simulated browser/API responses.

Additional context

A bounded fix should use a process-local update mutex, confirm and move to an immutable fetched target commit, identify the updater stash by a unique marker plus immutable OID, preserve the stash on conflict, and verify rollback before installation. Manual Git activity and separate server processes can remain explicitly outside the mutex boundary.

Template check

  • I DID NOT read this template and provide the requested details.
Originally created by @Xelvanis on GitHub (Jul 18, 2026). Original GitHub issue: https://github.com/Pasta-Devs/Marinara-Engine/issues/3787 ## Summary Browser-applied Git updates are not serialized server-side, and stash recovery is not tied to the exact stash created by the updater. Overlapping callers or a stash-apply conflict can leave the checkout ambiguous or conflicted before dependency installation and build steps run. ## Expected behavior Only one browser update should run per server process. The updater should capture its exact recovery stash, preserve it if restoration conflicts, clean and restore the original checkout after movement failures, and stop before installation unless Git reaches the confirmed target commit cleanly. ## Actual behavior The route relies on client-side button state rather than a server lock. It uses the current stash stack for restoration and suppresses stash failures, so another tab/API client or an intervening Git stash can race the update and recovery sequence. ## Steps to reproduce > This is a destructive source-audit scenario. Use a disposable Git clone, not a valuable installation. 1. Start a Git-based Marinara source install with tracked local changes. 2. Submit overlapping `POST /api/updates/apply` requests from separate tabs or API clients, or arrange for the updater stash to conflict when reapplied. 3. Observe that the Git, stash, install, and build operations are not server-serialized and stash restoration failures do not prevent the later update steps. ## Environment - Marinara Engine version: 2.3.3 - Install type: source / Git - OS + version: Microsoft Windows 11 Pro 10.0.26200; route behavior is platform-independent - Browser or app shell: browser settings panel or direct API client ## Logs, screenshots, or video No production incident log. The failure paths were identified through code audit and exercised with disposable Git fixtures and simulated browser/API responses. ## Additional context A bounded fix should use a process-local update mutex, confirm and move to an immutable fetched target commit, identify the updater stash by a unique marker plus immutable OID, preserve the stash on conflict, and verify rollback before installation. Manual Git activity and separate server processes can remain explicitly outside the mutex boundary. ## Template check - [ ] I DID NOT read this template and provide the requested details.
bsakaguchi 2026-10-21 05:44:52 +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#2043
No description provided.