The GitHub Actions job "Running Copilot Code Review" on texera.git/main has 
succeeded.
Run started by GitHub user Copilot (triggered by Copilot).

Head commit for run:
d1ac3a3eaf0d49d7eb57565f040844abed6a711b / Kunwoo (Chris) 
<[email protected]>
fix(file-service): reject invalid or duplicate dataset renames (#6426)

### What changes were proposed in this PR?

The dataset rename endpoint previously skipped both checks that dataset
creation enforces: name validation and the per owner duplicate name
check. A rename could therefore produce two datasets with the same
`(owner, name)` pair, which breaks every lookup that resolves a dataset
by `(owner email, dataset name)`. File uploads and workflow file reads
fail with a `TooManyRowsException` for both datasets.

This PR adds the missing guards to the backend rename endpoint, and a
`UNIQUE (owner_uid, name)` constraint at the database level so that
concurrent writes racing past the application-level check cannot
reintroduce duplicates. The migration script `sql/updates/28.sql`
deduplicates pre-existing duplicates before adding the constraint (the
oldest dataset keeps its name, later ones get a `-<did>` suffix). The
frontend rename input now applies the same name validation client-side
and shows the detailed reason from the backend when a rename is
rejected, instead of the generic "Update dataset name failed".

Some additional changes:
- `validateDatasetName` now also enforces the 128-character column limit
- DEFAULT_DATASET_NAME changed from "Untitled dataset" to
"Untitled-dataset", since the fallback name used for empty rename input
must itself pass the new validation

### Any related issues, documentation, discussions?

Closes #6424

### How was this PR tested?


https://github.com/user-attachments/assets/823bd44d-fef3-4aa0-b2c5-e6d27d359d9b

### Was this PR authored or co-authored using generative AI tooling?

Generated-by: Claude Code, Claude Fable 5

Report URL: https://github.com/apache/texera/actions/runs/29553911360

With regards,
GitHub Actions via GitBox

Reply via email to