Skip to content

remove --children can fail rollback and strand workspace data #35

Description

@gpu004

What I observed

remove --children can fail while rolling back a nested custom-storage layout, leaving registered workspaces at missing paths and data stranded under .trash.

Reproduction

cargo build --locked
probe=$(mktemp -d /tmp/rift-remove-children.XXXXXX)
mkdir -p "$probe/source"
printf 'keep me\n' > "$probe/source/valuable-data"

rift_bin="$PWD/target/debug/rift"
db="$probe/registry.sqlite"
"$rift_bin" --database "$db" init --here "$probe/source"
container=$("$rift_bin" --database "$db" create "$probe/source" --name container)
nested=$("$rift_bin" --database "$db" create "$probe/source" --name nested --into "$container/holding")

"$rift_bin" --database "$db" remove "$probe/source" --children
printf 'container=%s nested=%s\n' "$container" "$nested"
find "$probe" -name .rift -o -name valuable-data -print
sqlite3 "$db" 'select path from rift order by path; select count(*) from trash;'

The remove command exits 1 with:

No such file or directory (os error 2)

The source marker remains. The original container path is recreated as an empty directory tree without its marker, and the original nested path is missing. Both workspaces, their markers, and valuable-data are under .trash/<id>-container. SQLite still has all three active rows at their original paths and no trash rows.

Expected

If remove --children fails, rollback restores every child at its registered path with its marker and data.

Actual

Rollback leaves active registry rows pointing to missing or incomplete paths and strands the workspace data under trash storage.

Environment

  • Rift commit 757a22cb247f
  • macOS 26.6.2, arm64, APFS

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions