mattcasters opened a new pull request, #7798: URL: https://github.com/apache/hop/pull/7798
## Summary Fixes [#7797](https://github.com/apache/hop/issues/7797): File Explorer refresh often failed to show files/folders created by pipelines or other external writes, even after pressing F5. ### Root cause 1. **Scoped F5** (introduced for #7364 / #7426) only re-listed `lastSelectedFolderPath`. Almost any tree selection set that path, so F5 never rebuilt the rest of the tree. Files created under another folder stayed invisible. 2. **Lazy `loaded` flag** — once a folder had been expanded, `ensureFolderLoaded()` short-circuited and never re-scanned VFS. Collapse/expand did not help. 3. **VFS children cache** — Commons VFS caches directory children on `FileObject` until `refresh()`. Explorer listed without an explicit refresh, so external creates could remain hidden. ### Fix | Change | Detail | |--------|--------| | Hard F5 | Toolbar / `refresh()` always full-rebuilds via `refreshEntireTree()` (clears filter index; expands restored via `TreeMemory`) | | Fresh VFS lists | `listChildrenFresh()` calls `FileObject.refresh()` before `getChildren()` in tree + filter model walks | | Scoped refresh kept | Context menu **Refresh folder** + internal ops (delete parent fix-up, etc.) still use scoped refresh | | Path equality | `ExplorerPathUtils` normalizes separators / trailing slashes for locate/find | ### Reviewer notes - **Do not reintroduce** routing F5 through `refreshSelectedFolder()` — that was the main bug. - Expand/collapse restore path (`restoreTreeItemExpandedFromMemory` + `ensureFolderLoaded`) should still prevent blank dummy rows (#7525). - Full F5 is slightly heavier than scoped refresh on huge projects; that is intentional for a user “show me the truth” action. Scoped remains on the context menu. - No global VFS `CacheStrategy` change (`ON_CALL` would be project-wide cost); only explorer listings force refresh. - Toolbar annotation for F5 still sits on `clearSearchFilters()` (pre-existing); empty filter → `refresh()`, non-empty → clear filter then rebuild. Behavior of that wiring is unchanged aside from hard `refresh()`. ## Test plan - [x] `ExplorerPathUtilsTest` (separator / trailing-slash equality) - [x] `ExplorerTreeModelTest` - [x] `HopVfsTest` including `testRefreshClearsChildrenCacheForExternalCreates` - [ ] Manual: expand folders, select under e.g. `pipelines/`, create `output/new-run/file.txt` outside selection (pipeline or shell), press **F5** → new folder/file appear without selecting parent first - [ ] Manual: expand/collapse after F5 → no blank rows - [ ] Manual: filter active + F5 / clear filter still rebuilds correctly - [ ] Manual: context menu **Refresh folder** only updates selected subtree -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
