You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
iOS: a failed saveSource drops the error of deleting its half-made baseline clone #1804
#deleteSeedSimulator throws on a non-zero or timed-out simctl delete, and this .catch drops it unlogged. The row is then deleted (seeds.ts:185), so the clone stays in the sources set as an orphan source with no line naming its UDID. doctor still reports it.
Confirmed. src/drivers/ios/index-save-source-lifecycle.test.ts, "a failed save whose clone's delete then exits non-zero or times out logs the clone's UDID" (branch bug/1804-repro). The save fails after the clone is made (the row update is refused). Three cases: a delete that works (no warning), one that exits 1, one that times out.
pnpm exec vitest run --project unit src/drivers/ios/index-save-source-lifecycle.test.ts -t "logs the clone's UDID"
AssertionError: a delete that exits non-zero: expected [] to deeply equal [ Array(1) ]
- "could not delete baseline clone 00000000-0000-0000-0000-0000000000bb after a failed save: simctl delete 00000000-0000-0000-0000-0000000000bb exited with code 1: Unable to delete"
+ []
Root cause
Defect. src/drivers/ios/seeds.ts:183 runs this.#deleteSeedSimulator(cloneUdid).catch(() => undefined). #deleteSeedSimulator goes through #deleteIn (seeds.ts:489), which throws on a non-zero exit or a time-out. The .catch drops that error, and seeds.ts:185 then deletes the row. The clone stays in the sources set as an orphan source, and nothing logs its UDID. The symptom only shows later, when doctor lists an orphan nobody can explain.
Simplest fix
Log the delete error in the .catch and keep rethrowing the save's own error:
awaitthis.#deleteSeedSimulator(cloneUdid).catch((deleteError: unknown)=>{this.#logger?.warn(`could not delete baseline clone ${cloneUdid} after a failed save: ${errorMessage(deleteError)}`,);});
pnpm exec vitest run --project unit src/drivers/ios # with the fix
Test Files 34 passed (34)
Tests 766 passed | 1 skipped (767)
Alternatives rejected
Keep the making row while the clone is undeletable, so another process's sweep deletes it: that changes what doctor shows, and the sweep runs only after a restart.
Retry the delete: a timed-out simctl delete may still be running.
Activity
V3RON commentedon Nov 22, 2026
Reproduction
Confirmed.
src/drivers/ios/index-save-source-lifecycle.test.ts, "a failed save whose clone's delete then exits non-zero or times out logs the clone's UDID" (branchbug/1804-repro). The save fails after the clone is made (the row update is refused). Three cases: a delete that works (no warning), one that exits 1, one that times out.Root cause
Defect.
src/drivers/ios/seeds.ts:183runsthis.#deleteSeedSimulator(cloneUdid).catch(() => undefined).#deleteSeedSimulatorgoes through#deleteIn(seeds.ts:489), which throws on a non-zero exit or a time-out. The.catchdrops that error, andseeds.ts:185then deletes the row. The clone stays in the sources set as an orphan source, and nothing logs its UDID. The symptom only shows later, whendoctorlists an orphan nobody can explain.Simplest fix
Log the delete error in the
.catchand keep rethrowing the save's own error:Alternatives rejected
makingrow while the clone is undeletable, so another process's sweep deletes it: that changes whatdoctorshows, and the sweep runs only after a restart.simctl deletemay still be running.Risk
Invalid device) logs nothing, because#deleteIntreats it as deleted.Fast track
Side findings
Written by an agent.