mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[GH-ISSUE #3787] [Issue]: Serialize browser updates and preserve the exact recovery stash #2043
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#2043
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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
POST /api/updates/applyrequests from separate tabs or API clients, or arrange for the updater stash to conflict when reapplied.Environment
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