Skip to content

Commit 4fcc40e

Browse files
author
Roo Code
committed
debugging updated system
1 parent 769cef4 commit 4fcc40e

46 files changed

Lines changed: 66865 additions & 3377 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ webxr.long-type*
1616
qdrant_data/
1717
whelk-rs/
1818
.swarm/
19+
screenshots/
1920

2021
# Dependencies
2122
node_modules

client/.claude-flow/metrics/performance.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"startTime": 1767199573711,
3-
"sessionId": "session-1767199573711",
4-
"lastActivity": 1767199573711,
2+
"startTime": 1767214158204,
3+
"sessionId": "session-1767214158204",
4+
"lastActivity": 1767214158204,
55
"sessionDuration": 0,
66
"totalTasks": 1,
77
"successfulTasks": 1,
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
[
22
{
3-
"id": "cmd-hooks-1767199573821",
3+
"id": "cmd-hooks-1767214158311",
44
"type": "hooks",
55
"success": true,
6-
"duration": 5.723209999999995,
7-
"timestamp": 1767199573826,
6+
"duration": 213.45568100000003,
7+
"timestamp": 1767214158525,
88
"metadata": {}
99
}
1010
]

client/package-lock.json

Lines changed: 13 additions & 30 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@
108108
"string-width": "7.2.0",
109109
"wrap-ansi": "9.0.0",
110110
"esbuild": "0.25.9",
111-
"prismjs": "1.30.0"
111+
"prismjs": "1.30.0",
112+
"three": "0.182.0"
112113
}
113114
}

client/src/app/App.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import { VircadiaBridgesProvider } from '../contexts/VircadiaBridgesContext';
2525
import { useNostrAuth } from '../hooks/useNostrAuth';
2626
import { NostrLoginScreen } from '../components/NostrLoginScreen';
2727
import { LoadingScreen } from '../components/LoadingScreen';
28+
import { WorkerErrorModal } from '../components/WorkerErrorModal';
2829
import solidPodService from '../services/SolidPodService';
2930

3031
const logger = createLogger('App');
@@ -187,6 +188,7 @@ function App() {
187188
<ConnectionWarning />
188189
<CommandPalette />
189190
<DebugControlPanel />
191+
<WorkerErrorModal />
190192
</>
191193
)}
192194
</ApplicationModeProvider>

client/src/app/AppInitializer.tsx

Lines changed: 50 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React, { useEffect } from 'react';
22
import { createLogger, createErrorMetadata } from '../utils/loggerConfig';
33
import { debugState } from '../utils/clientDebugState';
44
import { useSettingsStore } from '../store/settingsStore';
5+
import { useWorkerErrorStore } from '../store/workerErrorStore';
56
import WebSocketService from '../services/WebSocketService';
67
import { graphWorkerProxy } from '../features/graph/managers/graphWorkerProxy';
78
import { graphDataManager } from '../features/graph/managers/graphDataManager';
@@ -74,10 +75,56 @@ const AppInitializer: React.FC<AppInitializerProps> = ({ onInitialized, onError
7475
logger.info('Starting application initialization...');
7576
}
7677

78+
// Set up retry handler for worker initialization
79+
const initializeWorker = async (): Promise<boolean> => {
80+
try {
81+
console.log('[AppInitializer] Step 1: Initializing graphWorkerProxy');
82+
await graphWorkerProxy.initialize();
83+
console.log('[AppInitializer] Step 1b: graphWorkerProxy initialized, ensuring graphDataManager worker connection');
84+
85+
// Ensure graphDataManager is connected to the worker now that it's ready
86+
const workerReady = await graphDataManager.ensureWorkerReady();
87+
console.log(`[AppInitializer] Step 1c: graphDataManager worker ready: ${workerReady}`);
88+
89+
if (!workerReady) {
90+
throw new Error('Graph worker failed to become ready after initialization');
91+
}
92+
93+
return true;
94+
} catch (workerError) {
95+
console.error('[AppInitializer] Worker initialization failed:', workerError);
96+
const errorMessage = workerError instanceof Error ? workerError.message : String(workerError);
97+
98+
// Check for SharedArrayBuffer-related issues
99+
let details = errorMessage;
100+
if (typeof SharedArrayBuffer === 'undefined') {
101+
details = 'SharedArrayBuffer is not available. This is required for the graph engine to function properly.';
102+
} else if (errorMessage.includes('Worker') || errorMessage.includes('worker')) {
103+
details = `Worker initialization error: ${errorMessage}`;
104+
}
105+
106+
useWorkerErrorStore.getState().setWorkerError(
107+
'The graph visualization engine failed to initialize.',
108+
details
109+
);
110+
111+
// Continue without worker - graceful degradation
112+
logger.warn('Continuing without fully initialized worker');
113+
return false;
114+
}
115+
};
116+
117+
// Store retry handler
118+
useWorkerErrorStore.getState().setRetryHandler(async () => {
119+
const success = await initializeWorker();
120+
if (!success) {
121+
throw new Error('Worker initialization retry failed');
122+
}
123+
});
124+
77125
try {
78-
console.log('[AppInitializer] Step 1: Initializing graphWorkerProxy');
79-
80-
await graphWorkerProxy.initialize();
126+
await initializeWorker();
127+
81128
console.log('[AppInitializer] Step 2: graphWorkerProxy initialized, calling settings initialize');
82129
await initialize();
83130
console.log('[AppInitializer] Step 3: Settings initialized');

client/src/app/main.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import { initializeDebugSystem } from '../utils/debugConfig';
99
import { unifiedApiClient } from '../services/api/UnifiedApiClient';
1010
import { initializeAuthInterceptor, setupAuthStateListener } from '../services/api/authInterceptor';
1111
import { useSettingsStore } from '../store/settingsStore';
12-
import { webSocketService } from '../services/WebSocketService';
12+
import { webSocketService, useWebSocketStore } from '../store/websocketStore';
1313
import '../styles/index.css';
1414

1515

@@ -19,8 +19,9 @@ initializeDebugSystem();
1919
// Expose stores and services for testing/debugging (dev mode only)
2020
if (import.meta.env.DEV) {
2121
(window as any).useSettingsStore = useSettingsStore;
22+
(window as any).useWebSocketStore = useWebSocketStore;
2223
(window as any).webSocketService = webSocketService;
23-
console.log('[Dev] Exposed useSettingsStore and webSocketService on window for testing');
24+
console.log('[Dev] Exposed useSettingsStore, useWebSocketStore, and webSocketService on window for testing');
2425
}
2526

2627
// Initialize authentication interceptor for all API calls

client/src/components/NostrLoginScreen.tsx

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,34 @@ export const NostrLoginScreen: React.FC = () => {
7373
>
7474
Retry After Installing Extension
7575
</button>
76+
77+
{isDevLoginAvailable && (
78+
<div className="dev-login-section">
79+
<div className="dev-login-divider">
80+
<span>Development Mode</span>
81+
</div>
82+
<button
83+
className="dev-login-button"
84+
onClick={handleDevLogin}
85+
disabled={isDevLoggingIn}
86+
>
87+
{isDevLoggingIn ? (
88+
<>
89+
<span className="spinner"></span>
90+
Logging in...
91+
</>
92+
) : (
93+
<>
94+
<span className="dev-icon">🔧</span>
95+
Dev Login (Bypass Extension)
96+
</>
97+
)}
98+
</button>
99+
<p className="dev-login-warning">
100+
⚠️ Development only - bypasses NIP-07 authentication
101+
</p>
102+
</div>
103+
)}
76104
</div>
77105
) : (
78106
<div className="nostr-login-form">

0 commit comments

Comments
 (0)