mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
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#6371
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?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/4422
Author: @Gunterlie
Created: 8/1/2026
Status: ✅ Merged
Merged: 8/1/2026
Merged by: @Gunterlie
Base:
staging← Head:fix/4421-stale-source-cleanup📝 Commits (3)
5926532fix: clear stale untracked source files on channel switch (#4421)b5d7637Merge branch 'staging' into fix/4421-stale-source-cleanup01b941dfix: cover manual apply and failed cleanup paths (#4421)📊 Changes
4 files changed (+86 additions, -2 deletions)
View changed files
📝
packages/server/src/routes/updates.routes.ts(+28 -1)📝
start-termux.sh(+19 -0)📝
start.bat(+20 -1)📝
start.sh(+19 -0)📄 Description
Fixes #4421.
Why
A user switching from the stable channel to staging can end up with a checkout that never builds again. Files that exist on
mainbut were deleted onstagingcan survive the switch as untracked leftovers — on Windows,git checkoutcan fail to delete an individual file (antivirus scanner or Windows Search indexer holding a brief lock) while still reporting the checkout as successful.tscthen picks the leftover up viainclude: ["src/**/*.ts"]and fails on types that no longer exist:The launchers turned that from a transient glitch into a permanent one.
git stash push -ucaptured the untracked leftover before every update andrestore_stashed_changesput it back afterwards, so the broken tree survived every relaunch. There was no way out short of the user deleting the file by hand — and no message telling them which file to delete.What changed
Untracked files under
packages/{shared,server,client}/srcare now removed:checkoutOrCreateUpdateBranch(packages/server/src/routes/updates.routes.ts)start.bat,start.sh, andstart-termux.shPlacement notes, both deliberate:
git stash push -u, so the stale file can't be captured and restored again.SKIP_UPDATE/AUTO_UPDATE_DISABLEDbails. Removing a file the checkout should have deleted is working-tree repair, not an update. Users with auto-update off previously jumped straight past any cleanup and stayed stuck indefinitely.All three launchers shared the same stash-and-restore cycle, so all three are patched — the bug was not Windows-specific in mechanism, only in trigger.
Safety of the scope:
.env, config, andnode_modulesare untouched.-x, so gitignored build output survives.-q, so git printsRemoving <path>when it actually deletes — a stray file of your own leaves a trace in the console instead of vanishing silently.A full
git clean -fdwould have been too aggressive (it could take.envand data files); thels-tree-diff alternative from the issue solves the same case with considerably more code.Verified
pnpm checkpasses.bash -non both shell launchers.data/and.envalone, and exits 0 when a pathspec doesn't exist.git clean -ndagainst this repo lists nothing, so the change is a no-op on a healthy tree.Not verified — needs a human on Windows
None of this has been run on Windows, and the bug is Windows-triggered.
start.bathas no automated test lane, so the ordering claim (clean runs beforestash push -u) is read off the control flow rather than observed. Please confirm before merging.Test plan
packages/shared/src/chat-mode-capabilities.tsopen during the switch) and manually verify the nextstart.batlaunch removes it and builds.start.batprintsRemoving <path>when it deletes a leftover, and prints nothing on a clean tree.AUTO_UPDATE_ENABLED=falsestill clears a stale file.packages/*/srcthat a developer created is reported before deletion (expected behaviour change — flag if too aggressive).start.shthat a normal launch and update are unaffected.start-termux.sh.Summary by CodeRabbit
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.