Activities of "b4y"

Title: File Management (Angular): opening a sub-folder from the list returns to the root when its tree node has not been loaded

  • ABP Framework version: v10.3.0 (@volo/abp.ng.file-management 10.3.0, @abp/ng.core 10.3.0)
  • UI Type: Angular 21.2, LeptonX 5.3.0
  • Database System: EF Core (SQL Server)
  • Auth Server Separated: yes
  • Exception message and full stack trace: none — no exception is thrown and nothing is logged. The navigation simply ends up in the wrong folder. The browser console is clean; the only visible trace is in the network tab (below).
  • Steps to reproduce the issue:
    1. Create a folder (in our case orders_exports) containing several dozen sub-folders — we have 77, one per order.
    2. Reload /file-management, so the directory tree holds only the root's children.
    3. In the content list, click orders_exports. It opens correctly — breadcrumb All files > orders_exports, 77 items.
    4. Click any sub-folder in the list.
    5. Expected: the sub-folder opens. Actual: the breadcrumb goes back to All files and the root content is listed.

The module is used as-is: route created with createRoutes(), no custom wrapper, no replaced components.


What the problem really is

A folder can only be opened if its node has already been loaded into the left-hand directory tree. Opening a sub-folder whose branch has never been expanded sends the user back to the root.

It works if orders_exports is first expanded with the + in the left tree, and then the same sub-folder is clicked. That is the only difference between the failing and the passing case.

It also happens through the filter box, which is how we first noticed it: filtering inside a folder shows the match, and clicking it returns to the root. The filter is not the cause — step 4 above reproduces it with no filter at all.

The problem only shows up with many sub-folders: with two or three the tree gets expanded easily and nothing looks wrong, which is probably why it has not been reported in this form.

Network evidence

before the click:  GET /api/file-management/directory-descriptor?id=89ba7949-…&skipCount=0&maxResultCount=10
after  the click:  GET /api/file-management/directory-descriptor?skipCount=0&maxResultCount=10

No id on the second one, i.e. the root.

Where it comes from

DirectoryTreeService.findFullPathOf(folder) rebuilds the path by walking this.treeHolder.getList(), which contains only the nodes already fetched into the tree. When the folder is not there, the while loop never runs and the method returns [ROOT_NODE].

NavigatorService.goToFolder() then undoes its own work:

goToFolder(folder) {
    this.currentFolder$.next(folder);     // correct folder
    this.updateCurrentFolderPath(folder); // -> next([...findFullPathOf(folder)])
}

next(newValue) {
    this.navigatedFolders = newValue;                  // [ROOT]
    this.currentFolder$.next(this.getCurrentFolder()); // overwrites with ROOT
    this.updateStream.patchStore({
        currentDirectory: this.getCurrentFolderId(),   // empty
    });
}

currentDirectory ends up empty, so the list reloads the root.

Suggested fix

As a minimum, when the path cannot be rebuilt, keep the folder itself rather than discarding it:

if (!retVal.length && folder?.id && folder.id !== ROOT_ID) {
    retVal.push(folder);
}

That alone makes the folder open, but the intermediate breadcrumb entries stay missing, and goUpFolder() then returns to the root instead of the parent, because the path is only [root, folder].

We went one step further in our local patch: when the clicked folder is not in the tree, we rebuild the real path from the server, walking up with DirectoryDescriptorService.get(id), which also returns parentId — two requests for a folder one level below the root. The breadcrumb is then complete and goUpFolder() behaves correctly, with the tree still collapsed.

Second issue, same screen

The filter box is not cleared when entering a folder. After filtering inside a folder and clicking a result, the newly opened folder is queried with the previous filter still applied, so it shows "No data available" even when it has contents. Clearing the box reveals them. We expect the filter to reset on folder change.

One detail if you fix it from outside FileManagementFolderFilterComponent: clearing list.filter from the content component re-queries correctly, but the input keeps showing the old text, because the filter component is OnPush and nothing marks it for check. We ended up clearing it inside the filter component itself.

Impact for us

Our operators reach every order's exported files through orders_exports. Until the patch, none of those folders could be opened from the list, so the files could not be downloaded.

Showing 1 to 1 of 1 entries
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.8.0-preview. Updated on October 21, 2026, 11:09
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.