mirror of
https://github.com/coleam00/Archon.git
synced 2025-12-24 02:39:17 -05:00
Update optimistic timestamp to enable smart merge strategy
- Set updated_at to current ISO timestamp during optimistic updates - Ensures smart merge logic triggers when server responses are stale - Fixes CodeRabbit review suggestion about timestamp comparison effectiveness 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -112,7 +112,10 @@ export function useUpdateTask(projectId: string) {
|
||||
// Optimistically update
|
||||
queryClient.setQueryData<Task[]>(taskKeys.all(projectId), (old) => {
|
||||
if (!old) return old;
|
||||
return old.map((task) => (task.id === taskId ? { ...task, ...updates } : task));
|
||||
const nowIso = new Date().toISOString();
|
||||
return old.map((task) =>
|
||||
task.id === taskId ? { ...task, ...updates, updated_at: nowIso } : task,
|
||||
);
|
||||
});
|
||||
|
||||
return { previousTasks };
|
||||
|
||||
Reference in New Issue
Block a user