Skip to content

Fix dataset delete confirmation to actually wait for user input #702

Description

@codekiln

Problem

The langstar dataset delete command displays a confirmation message but doesn't actually wait for user input. It immediately returns without deleting OR waiting for confirmation:

// cli/src/commands/dataset.rs:488-493
if !args.yes {
    eprintln!("Are you sure you want to delete dataset {}?", args.dataset_id);
    eprintln!("Use --yes (-y) to skip this confirmation.");
    return Ok(());  // ❌ Returns without deleting OR waiting
}

This makes the confirmation prompt misleading - it appears to protect the user but provides no protection at all.

Expected Behavior

The command should wait for user input and only proceed if they type "yes", following the same pattern as deployment delete:

// cli/src/commands/deployment.rs:602-611
use std::io::{self, Write};
print!("Type 'yes' to confirm: ");
io::stdout().flush()?;
let mut confirmation = String::new();
io::stdin().read_line(&mut confirmation)?;

if confirmation.trim().to_lowercase() != "yes" {
    println!("Deletion cancelled.");
    return Ok(());
}
// If we get here, proceed with deletion

Related

Discovered during code review in PR #701 (project commands). The project command has been implemented correctly with proper stdin confirmation.

Same issue exists in queue command - see related issue.

Acceptance Criteria

  • Dataset delete command waits for user to type "yes" before proceeding
  • Deletion is cancelled if user types anything other than "yes"
  • Follows same pattern as deployment.rs:602-611
  • Manual testing confirms confirmation works as expected

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

    wipwork in progress

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions