fix: count folder contents for delete on Helix 6 (#1034)#1048
Closed
chrischrischris wants to merge 1 commit into
Closed
fix: count folder contents for delete on Helix 6 (#1034)#1048chrischrischris wants to merge 1 commit into
chrischrischris wants to merge 1 commit into
Conversation
…1034) The delete confirmation crawled folder contents using nx's `crawl`, which lists against the DA origin only. On Helix 6 sites it found nothing, so the dialog reported "0 items" and the delete flow was confusing/broken. Replace the crawl with `crawlDeleteCount`, a recursive count built on the backend-aware `source.list` (the same API the listing uses), so it works for both the legacy DA and Helix 6 backends. Preserves cancellation semantics (cancelCrawl) and pagination handling. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch.
Commits
|
Contributor
Author
|
Closing in favor of the proper fix at the shared layer: adobe/da-nx#555 makes nx2's |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Fixes #1034.
On a Helix 6 site, deleting a folder from the browse UI shows a confirmation dialog asking to confirm the deletion of 0 items (and the flow is confusing/broken).
Root cause
handleDeletecounts the files inside a selected folder by crawling it. That crawl used nx'scrawlhelper (tree.js), which lists only against the DA origin (${DA_ORIGIN}/list). On a Helix 6 site the content lives behind a different backend, so the crawl found nothing →_deleteCountcame back0.Every other listing in
da-list.jsalready usessource.list, which is backend-aware (isHlx6()routes to the correct origin for both the legacy DA and Helix 6 backends).Fix
blocks/browse/da-list/helpers/utils.js— addcrawlDeleteCount, a recursive file-counter built on the backend-awaresource.list. It paginates via the continuation token, recurses into subfolders with bounded concurrency, and exposes the same{ results, cancelCrawl }shape the old crawl had.blocks/browse/da-list/da-list.js—handleDeletenow callscrawlDeleteCountwith the nx2sourceinstead of nx's DA-onlycrawl. Cancellation (cancelCrawl) and the mid-crawl bail-out checks are preserved unchanged.test/unit/blocks/browse/helpers/helpers.test.js— new tests: recursive counting, standalone-file inclusion, pagination, cancellation stops recursion, and graceful handling of a non-ok listing.The actual deletion already worked (it uses backend-aware
source.delete/source.move) — only the confirmation count was broken. This now works for both backends.Testing
da-listunit tests: 99 passedeslinton changed files: clean🤖 Generated with Claude Code