Skip to content

fix(frontend, v1.3): refresh a dataset's paths after a rename, and block renaming mid-upload - #8620

Merged
mengw15 merged 1 commit into
apache:release/v1.3from
mengw15:backport/8347-refresh-a-dataset-s-paths-after-a-rename-v1.3
Sep 21, 2026
Merged

mengw15 merged 1 commit into
apache:release/v1.3from
mengw15:backport/8347-refresh-a-dataset-s-paths-after-a-rename-v1.3

Conversation

@mengw15

@mengw15 mengw15 commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

Backport of #8347 to release/v1.3: a clean cherry-pick of its squash commit, no adaptations — the backport commit reuses the squash message and author, as the automated fast path would. See #8347 for the change itself (after a rename the detail page kept serving the old paths, so file preview and single-file download 404'd until a reload; renaming during an upload was also allowed).

Opened manually by the v1.3 release manager: the automated fast path cherry-picked this cleanly and then pushed it straight to release/v1.3, where the Merge Queue ruleset rejected the push (GH013, run 33706287941). The Actions-app bypass meant to unblock that path (#8379) was never created — asfyaml rejects an Integration bypass actor — and the failing job's notification 403s for want of pull-requests: write, so the loss left neither a backport PR nor a comment on #8347. See #8377.

Source: 4ff0b8b

Any related issues, documentation, discussions?

Backport of #8347. Originally linked #8345.

How was this PR tested?

The change is identical to #8347, which carries the specs (dataset-detail.component.spec.ts); the backport tree is verified byte-identical to cherry-picking the squash commit onto release/v1.3, and release-branch CI runs the full matrix on this PR. It touches the same three files as #8343's backport; the two apply cleanly onto this branch in either order.

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

Yes. Generated-by: Claude Code (claude-opus-5)

…naming mid-upload (apache#8347)

### What changes were proposed in this PR?

Every file path on a dataset's detail page embeds the dataset name, and
preview and single-file
download resolve a dataset by (owner, name). `onSaveDatasetName()`
updated the displayed name and
nothing else, so after a rename the page kept serving the old paths: the
file tree and the path above
the preview still said the old name, clicking a file hung on "File
content is loading" (404, then
500), and the Data Card's "Latest version file" was stale too. Only a
reload recovered.

The same rename was also allowed while an upload was running. The upload
is addressed by the name it
started with, so the data uploaded fine and then the completing call
failed with
`400 {"code":400,"message":"Dataset not found"}`, leaving the panel on
"Uploading: 1 file(s)" forever
and a row behind in `dataset_upload_session`.

- `dataset-detail.component.ts` — after a successful rename, refetch the
browsed version's file tree
and the Data Card's latest-version facts. The selected version is kept
deliberately;
`retrieveDatasetVersionList()` would also refresh both but resets the
picker to the newest version,
  which a rename is no reason to do.
- `dataset-detail.component.ts` / `.html` — bind the uploader's existing
`uploadsInFlightChange`,
disable the name field and Save while an upload is running, show a hint
saying why, and guard
  `onSaveDatasetName()` on the same invariant.

Note the browsed file resets to the version's first file after a rename,
because the dataset page
does not track the open file's relative path the way the model page
does. That is a small change in
behaviour from a page that was previously broken; tracking the open path
can follow separately if it
is worth it.

**Before** — renamed, but the path still says `sensor-readings` and the
preview hangs (console output
overlaid so it fits in one screenshot); the Data Card keeps the old path
too:
<img width="1440" height="900" alt="image"
src="https://github.com/user-attachments/assets/330c06d6-a65a-409c-bf80-53b46c4d334c"
/>
<img width="1440" height="900" alt="image"
src="https://github.com/user-attachments/assets/53da25ab-2220-45f3-96c0-6f7012202bc0"
/>

**After** — the path and the Data Card both follow the new name, and the
file opens:

<!-- attach issue2-2-stale-tree-after.png -->
<!-- attach issue2-4-data-card-after.png -->

**After** — renaming is blocked while an upload is in flight:

<img width="1440" height="900" alt="image"
src="https://github.com/user-attachments/assets/7b0a7540-82fe-4403-8de3-eb9e2dae119b"
/>

### Any related issues, documentation, discussions?

Closes apache#8345.

### How was this PR tested?

Three cases added to `dataset-detail.component.spec.ts`:

- `refetches the file tree and the latest-version facts, which both
embed the old name` — asserts both
fetches happen with the browsed `dvid`, and that the selected version is
unchanged. Removing the
  two refresh calls fails this test.
- `refuses to rename while an upload is in flight, which would strand
it`.
- `locks the name field while an upload is in flight` — drives the real
uploader output through the
  rendered template and checks the input and Save button are disabled.

```
cd frontend
npx ng test --include src/app/dashboard/component/user/user-dataset/user-dataset-explorer/dataset-detail.component.spec.ts
# Tests  145 passed (145)
```

Also checked by hand against a local stack, with the file uploads
throttled so the upload stays in
flight: renaming now leaves the tree, the path header and the Data Card
all on the new name and files
still open, and the name field is greyed out with the hint while an
upload runs.

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

(backported from commit 4ff0b8b)

Generated-by: Claude Code (Opus 5)
@github-actions github-actions Bot added the frontend Changes related to the frontend GUI label Sep 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Automated Reviewer Suggestions

Based on the git blame history of the changed files, we recommend the following reviewers:

  • Contributors with relevant context: @tanishqgandhi1908, @aglinxinyuan
    You can notify them by mentioning @tanishqgandhi1908, @aglinxinyuan in a comment.

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.07%. Comparing base (5036097) to head (7a914c0).

Additional details and impacted files
@@               Coverage Diff               @@
##             release/v1.3    #8620   +/-   ##
===============================================
  Coverage           94.06%   94.07%           
  Complexity           4808     4808           
===============================================
  Files                1194     1194           
  Lines               48601    48615   +14     
  Branches             5860     5862    +2     
===============================================
+ Hits                45718    45733   +15     
  Misses               1429     1429           
+ Partials             1454     1453    -1     
Flag Coverage Δ *Carryforward flag
access-control-service 81.00% <ø> (ø) Carriedforward from 5036097
agent-service 99.32% <ø> (ø) Carriedforward from 5036097
amber 90.10% <ø> (ø) Carriedforward from 5036097
computing-unit-managing-service 73.67% <ø> (ø) Carriedforward from 5036097
config-service 87.00% <ø> (ø) Carriedforward from 5036097
file-service 87.75% <ø> (ø) Carriedforward from 5036097
frontend 96.82% <100.00%> (+<0.01%) ⬆️
notebook-migration-service 79.31% <ø> (ø) Carriedforward from 5036097
pyamber 98.18% <ø> (ø) Carriedforward from 5036097
workflow-compiling-service 77.19% <ø> (ø) Carriedforward from 5036097

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@xuang7 xuang7 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mengw15
mengw15 added this pull request to the merge queue Sep 21, 2026
Merged via the queue into apache:release/v1.3 with commit de57530 Sep 21, 2026
25 checks passed
@mengw15
mengw15 deleted the backport/8347-refresh-a-dataset-s-paths-after-a-rename-v1.3 branch September 21, 2026 20:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend Changes related to the frontend GUI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants