Bug: Session files can become orphaned (exist but not in index) #66
Reference in New Issue
Block a user
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?
Bug
Session files in
~/.kugetsu/sessions/can become orphaned - they exist but are not tracked in~/.kugetsu/index.json. This causeskugetsu destroyto fail:Even though the session file exists:
Root Cause
When
kugetsu startcreates a new session:~/.kugetsu/sessions/~/.kugetsu/index.jsonwith the issue mappingBut if step 1 succeeds and step 2 fails (e.g., crash, signal), the session file exists but index doesn't have it.
Impact
kugetsu destroy <issue>fails for orphaned sessionskugetsu listshows incomplete stateExpected Behavior
kugetsu destroyshould handle orphaned sessions gracefully:Possible Fixes
kugetsu prune --force) but doesn't remove session files that ARE orphanedTest Case
kugetsu destroy <issue>- should succeed and clean up file