mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-03-18 22:33:08 +00:00
Fix Docker Compose CORS issues with nginx API proxying (#793)
* Changes from fix/docker-compose-cors-error * Update apps/server/src/index.ts Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> * Fix: Delete Worktree Crash + PR Comments + Dev Server UX Improvements (#792) * Changes from fix/delete-worktree-hotifx * fix: Improve bot detection and prevent UI overflow issues - Include GitHub app-initiated comments in bot detection - Wrap handleQuickCreateSession with useCallback to fix dependency issues - Truncate long branch names in agent header to prevent layout overflow * feat: Support GitHub App comments in PR review and fix session filtering * feat: Return invalidation result from delete session handler * fix: Improve CORS origin validation to handle wildcard correctly * fix: Correct IPv6 localhost parsing and improve responsive UI layouts * Changes from fix/pwa-cache-fix (#794) * fix: Add type checking to prevent crashes from malformed cache entries --------- Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This commit is contained in:
@@ -174,13 +174,19 @@ export function restoreFromUICache(
|
||||
) {
|
||||
const sanitized: Record<string, { path: string | null; branch: string }> = {};
|
||||
for (const [projectPath, worktree] of Object.entries(cache.cachedCurrentWorktreeByProject)) {
|
||||
if (worktree.path === null) {
|
||||
if (
|
||||
typeof worktree === 'object' &&
|
||||
worktree !== null &&
|
||||
'path' in worktree &&
|
||||
worktree.path === null
|
||||
) {
|
||||
// Main branch selection — always safe to restore
|
||||
sanitized[projectPath] = worktree;
|
||||
}
|
||||
// Non-null paths are dropped; the app will re-discover actual worktrees
|
||||
// from the server and the validation effect in use-worktrees will handle
|
||||
// resetting to main if the cached worktree no longer exists.
|
||||
// Null/malformed entries are also dropped to prevent crashes.
|
||||
}
|
||||
if (Object.keys(sanitized).length > 0) {
|
||||
stateUpdate.currentWorktreeByProject = sanitized;
|
||||
|
||||
Reference in New Issue
Block a user