mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-03-24 00:13:07 +00:00
Feature: Add PR review comments and resolution, improve AI prompt handling (#790)
* feat: Add PR review comments and resolution endpoints, improve prompt handling * Feature: File Editor (#789) * feat: Add file management feature * feat: Add auto-save functionality to file editor * fix: Replace HardDriveDownload icon with Save icon for consistency * fix: Prevent recursive copy/move and improve shell injection prevention * refactor: Extract editor settings form into separate component * ``` fix: Improve error handling and stabilize async operations - Add error event handlers to GraphQL process spawns to prevent unhandled rejections - Replace execAsync with execFile for safer command execution and better control - Fix timeout cleanup in withTimeout generator to prevent memory leaks - Improve outdated comment detection logic by removing redundant condition - Use resolveModelString for consistent model string handling - Replace || with ?? for proper falsy value handling in dialog initialization - Add comments clarifying branch name resolution logic for local branches with slashes - Add catch handler for project selection to handle async errors gracefully ``` * refactor: Extract PR review comments logic to dedicated service * fix: Improve robustness and UX for PR review and file operations * fix: Consolidate exec utilities and improve type safety * refactor: Replace ScrollArea with div and improve file tree layout
This commit is contained in:
@@ -400,19 +400,16 @@ function RootLayoutContent() {
|
||||
useEffect(() => {
|
||||
const handleLoggedOut = () => {
|
||||
logger.warn('automaker:logged-out event received!');
|
||||
// Only update auth state — the centralized routing effect will handle
|
||||
// navigation to /logged-out when it detects isAuthenticated is false
|
||||
useAuthStore.getState().setAuthState({ isAuthenticated: false, authChecked: true });
|
||||
|
||||
if (location.pathname !== '/logged-out') {
|
||||
logger.warn('Navigating to /logged-out due to logged-out event');
|
||||
navigate({ to: '/logged-out' });
|
||||
}
|
||||
};
|
||||
|
||||
window.addEventListener('automaker:logged-out', handleLoggedOut);
|
||||
return () => {
|
||||
window.removeEventListener('automaker:logged-out', handleLoggedOut);
|
||||
};
|
||||
}, [location.pathname, navigate]);
|
||||
}, []);
|
||||
|
||||
// Global listener for server offline/connection errors.
|
||||
// This is triggered when a connection error is detected (e.g., server stopped).
|
||||
@@ -724,33 +721,31 @@ function RootLayoutContent() {
|
||||
}
|
||||
|
||||
// If we can't load settings, we must NOT start syncing defaults to the server.
|
||||
// Only update auth state — the routing effect handles navigation to /logged-out.
|
||||
// Calling navigate() here AND in the routing effect causes duplicate navigations
|
||||
// that can trigger React error #185 (maximum update depth exceeded) on cold start.
|
||||
useAuthStore.getState().setAuthState({ isAuthenticated: false, authChecked: true });
|
||||
signalMigrationComplete();
|
||||
if (location.pathname !== '/logged-out' && location.pathname !== '/login') {
|
||||
navigate({ to: '/logged-out' });
|
||||
}
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
// Session is definitively invalid (server returned 401/403) - treat as not authenticated
|
||||
// Session is definitively invalid (server returned 401/403) - treat as not authenticated.
|
||||
// Only update auth state — the routing effect handles navigation to /logged-out.
|
||||
// Calling navigate() here AND in the routing effect causes duplicate navigations
|
||||
// that can trigger React error #185 (maximum update depth exceeded) on cold start.
|
||||
useAuthStore.getState().setAuthState({ isAuthenticated: false, authChecked: true });
|
||||
// Signal migration complete so sync hook doesn't hang (nothing to sync when not authenticated)
|
||||
signalMigrationComplete();
|
||||
|
||||
// Redirect to logged-out if not already there or login
|
||||
if (location.pathname !== '/logged-out' && location.pathname !== '/login') {
|
||||
navigate({ to: '/logged-out' });
|
||||
}
|
||||
}
|
||||
} catch (error) {
|
||||
logger.error('Failed to initialize auth:', error);
|
||||
// On error, treat as not authenticated
|
||||
// On error, treat as not authenticated.
|
||||
// Only update auth state — the routing effect handles navigation to /logged-out.
|
||||
// Calling navigate() here AND in the routing effect causes duplicate navigations
|
||||
// that can trigger React error #185 (maximum update depth exceeded) on cold start.
|
||||
useAuthStore.getState().setAuthState({ isAuthenticated: false, authChecked: true });
|
||||
// Signal migration complete so sync hook doesn't hang
|
||||
signalMigrationComplete();
|
||||
if (location.pathname !== '/logged-out' && location.pathname !== '/login') {
|
||||
navigate({ to: '/logged-out' });
|
||||
}
|
||||
} finally {
|
||||
authCheckRunning.current = false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user