From f5d05b15997a2bab95c67ebe2a36ea0761f1f202 Mon Sep 17 00:00:00 2001 From: Marcin Rataj Date: Wed, 29 Jul 2026 15:00:14 +0200 Subject: [PATCH] fix(files): refetch after navigating mid-load doFilesFetch does nothing while another listing is in flight, so navigating during a slow load dropped the new path's fetch, and nothing retried it. The view then held content for the path we had left, which the stale-path guard renders as an empty screen: no listing, and no error page for a path that does not exist. Re-check the route once the in-flight fetch settles and fetch again if it moved. Also runs when the fetch fails, since that leaves the new path just as unfetched. --- src/bundles/files/actions.js | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/bundles/files/actions.js b/src/bundles/files/actions.js index ea94ce634..ab6bf0ce1 100644 --- a/src/bundles/files/actions.js +++ b/src/bundles/files/actions.js @@ -191,8 +191,20 @@ const actions = () => ({ const isConnected = store.selectIpfsConnected() const isFetching = store.selectFilesIsFetching() const info = store.selectFilesPathInfo() - if (isReady && isConnected && !isFetching && info) { + if (!isReady || !isConnected || !info || isFetching) return + + try { await store.doFetch(info) + } finally { + // Navigating away while a listing is in flight makes that navigation's own + // doFilesFetch() a no-op, because of the isFetching check above, and + // nothing else retries it. Without this the view keeps waiting on content + // for a path we already left. Runs on failure too, since a rejected fetch + // leaves the new path just as unfetched. + const current = store.selectFilesPathInfo() + if (current && current.path !== info.path) { + await store.doFilesFetch() + } } },