termdock 1.4.197 → 1.4.198

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -49,7 +49,12 @@ const MAX_BRANCH_DIFF_NAME_BYTES = 256 * 1024;
49
49
  const MAX_BRANCH_DIFF_LOG_BYTES = 256 * 1024;
50
50
  const MAX_UNTRACKED_DIFF_FILE_BYTES = 1024 * 1024; // 1MB
51
51
  const MAX_NESTED_GIT_REPOS = 32;
52
- const NESTED_GIT_DISCOVERY_TIMEOUT_MS = 1_000;
52
+ // Walking a large non-repo tree (datasets/, models/) costs ~1s per 50k entries,
53
+ // and the walk order is depth-first: a budget that expires mid-walk drops every
54
+ // repo sitting after the slow directory. 1s cut real workspaces down to a
55
+ // handful of repos with no signal. Budget generously instead — the result is
56
+ // cached, so this only bounds a cold scan.
57
+ const NESTED_GIT_DISCOVERY_TIMEOUT_MS = 10_000;
53
58
  const NESTED_GIT_DISCOVERY_CACHE_TTL_MS = 60_000;
54
59
  const FS_ROUTE_TIMEOUT_MS = 6_000;
55
60
  const HEIC_PREVIEW_TIMEOUT_MS = 30_000;
@@ -2536,8 +2541,18 @@ async function getCachedNestedGitRoots(workspaceRoot, options = {}) {
2536
2541
  }
2537
2542
  const promise = discoverNestedGitRoots(workspaceRoot, options.signal)
2538
2543
  .then((result) => {
2544
+ // A truncated walk has no expiry of its own: the cache now holds a repo
2545
+ // list that is missing entries, and every rescan that truncates again
2546
+ // returns that same short list — so manual refresh could never recover.
2547
+ // Keep the longer of the two lists and let it expire, so the next scan
2548
+ // gets a chance to finish.
2539
2549
  if (result.truncated && cached?.result.repositories.length) {
2540
- return { ...cached.result, truncated: true };
2550
+ const merged = cached.result.repositories.length >= result.repositories.length ? cached.result : result;
2551
+ nestedGitRootsCache.set(workspaceRoot, {
2552
+ result: { ...merged, truncated: true },
2553
+ expiresAt: now + NESTED_GIT_DISCOVERY_CACHE_TTL_MS,
2554
+ });
2555
+ return { ...merged, truncated: true };
2541
2556
  }
2542
2557
  nestedGitRootsCache.set(workspaceRoot, {
2543
2558
  result,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "termdock",
3
- "version": "1.4.197",
3
+ "version": "1.4.198",
4
4
  "description": "A complete web-based terminal application with modern UI",
5
5
  "type": "module",
6
6
  "main": ".desktop-dist/main.js",
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
3
  "packageName": "termdock",
4
- "version": "1.4.197",
4
+ "version": "1.4.198",
5
5
  "runtimeProtocolVersion": 1,
6
6
  "minimumDesktopVersion": "1.4.46",
7
7
  "nodeMajor": 22,
8
8
  "dependencyHash": "sha256-K4KyYJuVoQDpZsBM8ZX1Rw3MddOxAzVdp/cPm0iGZz0=",
9
- "serverBundleHash": "sha256-+T9vc3U3rPgbrg1oKb9GWwaTbuYXTow0I3cAqV6TIlc=",
9
+ "serverBundleHash": "sha256-twQsOYoqr9YzoP1c9026oaRTwEqiTvtqMd6H5/oxMFY=",
10
10
  "clientBundleHash": "sha256-GKvLn08PjXFK40TGm1OlgtPAA9Tcvy+GYnD2hU+pys0=",
11
11
  "entrypoint": "dist/server/cli.js",
12
12
  "clientEntrypoint": "dist/client/index.html"