mirror of
https://github.com/coleam00/Archon.git
synced 2026-01-01 04:09:08 -05:00
Remove console logs
This commit is contained in:
@@ -118,10 +118,7 @@ export const TasksTab = ({
|
|||||||
// Optimized socket handlers with conflict resolution
|
// Optimized socket handlers with conflict resolution
|
||||||
const handleTaskUpdated = useCallback((message: any) => {
|
const handleTaskUpdated = useCallback((message: any) => {
|
||||||
const updatedTask = message.data || message;
|
const updatedTask = message.data || message;
|
||||||
console.log('📝 Real-time task updated received:', updatedTask);
|
|
||||||
|
|
||||||
const mappedTask = mapDatabaseTaskToUITask(updatedTask);
|
const mappedTask = mapDatabaseTaskToUITask(updatedTask);
|
||||||
console.log('📝 Mapped task:', mappedTask);
|
|
||||||
|
|
||||||
// Skip updates for recently deleted tasks (race condition prevention)
|
// Skip updates for recently deleted tasks (race condition prevention)
|
||||||
if (recentlyDeletedIdsRef.current.has(updatedTask.id)) {
|
if (recentlyDeletedIdsRef.current.has(updatedTask.id)) {
|
||||||
@@ -134,7 +131,6 @@ export const TasksTab = ({
|
|||||||
console.log('[Socket] Skipping echo update for locally updated task:', updatedTask.id);
|
console.log('[Socket] Skipping echo update for locally updated task:', updatedTask.id);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
console.log('[Socket] Not an echo, applying update for task:', updatedTask.id);
|
|
||||||
|
|
||||||
// Skip updates while modal is open for the same task to prevent conflicts
|
// Skip updates while modal is open for the same task to prevent conflicts
|
||||||
if (isModalOpen && editingTask?.id === updatedTask.id) {
|
if (isModalOpen && editingTask?.id === updatedTask.id) {
|
||||||
@@ -147,13 +143,10 @@ export const TasksTab = ({
|
|||||||
const existingTask = prev.find(task => task.id === updatedTask.id);
|
const existingTask = prev.find(task => task.id === updatedTask.id);
|
||||||
|
|
||||||
if (!existingTask) {
|
if (!existingTask) {
|
||||||
console.log('[Socket] Task not found locally, skipping update for:', updatedTask.id);
|
// Task not found locally, skip the update
|
||||||
console.log('[Socket] Current task IDs:', prev.map(t => t.id));
|
|
||||||
return prev;
|
return prev;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log('[Socket] Updating task from:', existingTask.status, 'to:', mappedTask.status);
|
|
||||||
|
|
||||||
const updated = prev.map(task =>
|
const updated = prev.map(task =>
|
||||||
task.id === updatedTask.id
|
task.id === updatedTask.id
|
||||||
? { ...mappedTask }
|
? { ...mappedTask }
|
||||||
@@ -696,7 +689,6 @@ export const TasksTab = ({
|
|||||||
return updated;
|
return updated;
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log('[TasksTab] Task created successfully with optimistic update');
|
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Failed to create task:', error);
|
console.error('Failed to create task:', error);
|
||||||
|
|||||||
Reference in New Issue
Block a user