Repository: remix-run/react-router
File: packages/react-router/lib/dom/ssr/fog-of-war.ts (TypeScript)

Code before:
        }

        sessionStorage.setItem(MANIFEST_VERSION_STORAGE_KEY, manifest.version);
      } catch (error) {
        // Catches when storage is blocked
        // Skip version tracking and continue with reload
      }

      window.location.href = errorReloadPath;
      console.warn("Detected manifest version mismatch, reloading...");

      // Stall here and let the browser reload and avoid triggering a flash of
      // an ErrorBoundary if we threw (same thing we do in `loadRouteModule()`)
      await new Promise(() => {
        // check out of this hook cause the DJs never gonna re[s]olve this
      });
    } else if (res.status >= 400) {
      throw new Error(await res.text());
    }

    // Reset loop-detection on a successful response
    try {
      sessionStorage.removeItem(MANIFEST_VERSION_STORAGE_KEY);
    } catch {
      // Catches when storage is blocked
      // Skip version tracking and continue with reload
    }
    serverPatches = (await res.json()) as AssetsManifest["routes"];
  } catch (e) {
    if (signal?.aborted) return;
    throw e;
  }

  // Patch routes we don't know about yet into the manifest
  let knownRoutes = new Set(Object.keys(manifest.routes));
  let patches = Object.values(serverPatches).reduce((acc, route) => {
    if (route && !knownRoutes.has(route.id)) {
      acc[route.id] = route;
    }
    return acc;
  }, {} as RouteManifest<EntryRoute>);
  Object.assign(manifest.routes, patches);

  // Track discovered paths so we don't have to fetch them again
  paths.forEach((p) => addToFifoQueue(p, discoveredPaths));

  // Identify all parentIds for which we have new children to add and patch
  // in their new children
  let parentIds = new Set<string | undefined>();
  Object.values(patches).forEach((patch) => {
    if (patch && (!patch.parentId || !patches[patch.parentId])) {

Review comment (suggestion):
```suggestion
      // Session storage unavailable
```

Code after:
        }

        sessionStorage.setItem(MANIFEST_VERSION_STORAGE_KEY, manifest.version);
      } catch {
        // Session storage unavailable
      }

      window.location.href = errorReloadPath;
      console.warn("Detected manifest version mismatch, reloading...");

      // Stall here and let the browser reload and avoid triggering a flash of
      // an ErrorBoundary if we threw (same thing we do in `loadRouteModule()`)
      await new Promise(() => {
        // check out of this hook cause the DJs never gonna re[s]olve this
      });
    } else if (res.status >= 400) {
      throw new Error(await res.text());
    }

    // Reset loop-detection on a successful response
    try {
      sessionStorage.removeItem(MANIFEST_VERSION_STORAGE_KEY);
    } catch {
      // Session storage unavailable
    }
    serverPatches = (await res.json()) as AssetsManifest["routes"];
  } catch (e) {
    if (signal?.aborted) return;
    throw e;
  }

  // Patch routes we don't know about yet into the manifest
  let knownRoutes = new Set(Object.keys(manifest.routes));
  let patches = Object.values(serverPatches).reduce((acc, route) => {
    if (route && !knownRoutes.has(route.id)) {
      acc[route.id] = route;
    }
    return acc;
  }, {} as RouteManifest<EntryRoute>);
  Object.assign(manifest.routes, patches);

  // Track discovered paths so we don't have to fetch them again
  paths.forEach((p) => addToFifoQueue(p, discoveredPaths));

  // Identify all parentIds for which we have new children to add and patch
  // in their new children
  let parentIds = new Set<string | undefined>();
  Object.values(patches).forEach((patch) => {
    if (patch && (!patch.parentId || !patches[patch.parentId])) {
      parentIds.add(patch.parentId);
    }