Skip to content

Comments

Sync desktop/ from omi-desktop (474e1e1f)#4955

Closed
m13v wants to merge 1 commit intomainfrom
sync/desktop-20260222-171627
Closed

Sync desktop/ from omi-desktop (474e1e1f)#4955
m13v wants to merge 1 commit intomainfrom
sync/desktop-20260222-171627

Conversation

@m13v
Copy link
Collaborator

@m13v m13v commented Feb 22, 2026

Automated sync from omi-desktop at 474e1e1f.

This PR was created by the sync pipeline.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

The pull request introduces several significant improvements, including the transition to the ACPBridge for AI chat, local-first task management in TasksStore, and enhanced UI/UX for tasks and onboarding. The improved accessibility checks and memory management for subprocesses like ffmpeg are also noteworthy. However, there is a regression in the window resizing logic in TasksPage and potential thread safety issues in TasksStore that should be addressed.

Comment on lines +2227 to +2238
NSAnimationContext.runAnimationGroup({ context in
context.duration = 0.25
context.timingFunction = CAMediaTimingFunction(name: .easeInEaseOut)
window.animator().setFrame(frame, display: true)
}
}, completionHandler: {
// Clear preChatWindowWidth only after the resize animation completes.
// If the app quits mid-animation, this won't fire, leaving the saved
// width intact so restorePreChatWindowWidth() can shrink on next launch.
if !expand {
UserDefaults.standard.set(Double(0), forKey: "tasksPreChatWindowWidth")
}
})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

The local @State variable preChatWindowWidth is not reset to 0 when the chat panel is closed. While the UserDefaults key is cleared in the completion handler, the local state remains at its previous value. This will cause the if preChatWindowWidth == 0 check to be skipped the next time the chat is opened, potentially leading to incorrect window sizing if the window was resized while the chat was closed.

        NSAnimationContext.runAnimationGroup({ context in
            context.duration = 0.25
            context.timingFunction = CAMediaTimingFunction(name: .easeInEaseOut)
            window.animator().setFrame(frame, display: true)
        }, completionHandler: {
            // Clear preChatWindowWidth only after the resize animation completes.
            // If the app quits mid-animation, this won't fire, leaving the saved
            // width intact so restorePreChatWindowWidth() can shrink on next launch.
            if !expand {
                self.preChatWindowWidth = 0
                UserDefaults.standard.set(Double(0), forKey: "tasksPreChatWindowWidth")
            }
        })

Comment on lines +1200 to +1202
if let idx = self.incompleteTasks.firstIndex(where: { $0.id == localTask.id }) {
self.incompleteTasks[idx] = created
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Modifying self.incompleteTasks (a @Published property) inside a background Task without ensuring it runs on the main actor is unsafe. Since TasksStore is a class and this Task is not explicitly isolated, this modification can occur on a background thread, leading to race conditions or runtime crashes in SwiftUI.

Suggested change
if let idx = self.incompleteTasks.firstIndex(where: { $0.id == localTask.id }) {
self.incompleteTasks[idx] = created
}
// Replace local_ entry with real backend-synced task
await MainActor.run {
if let idx = self.incompleteTasks.firstIndex(where: { $0.id == localTask.id }) {
self.incompleteTasks[idx] = created
}
}

Comment on lines +1373 to +1383
if let updatedTask = try? await ActionItemStorage.shared.getLocalActionItem(byBackendId: task.id) {
if task.completed {
if let index = completedTasks.firstIndex(where: { $0.id == task.id }) {
completedTasks[index] = updatedTask
}
} else {
if let index = incompleteTasks.firstIndex(where: { $0.id == task.id }) {
incompleteTasks[index] = updatedTask
}
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Modifying @Published properties like completedTasks and incompleteTasks from an async method without ensuring main-thread execution is unsafe. These updates should be wrapped in await MainActor.run to prevent threading issues in the UI layer.

        // 2. Read back and update in-memory
        if let updatedTask = try? await ActionItemStorage.shared.getLocalActionItem(byBackendId: task.id) {
            await MainActor.run {
                if task.completed {
                    if let index = completedTasks.firstIndex(where: { $0.id == task.id }) {
                        completedTasks[index] = updatedTask
                    }
                } else {
                    if let index = incompleteTasks.firstIndex(where: { $0.id == task.id }) {
                        incompleteTasks[index] = updatedTask
                    }
                }
            }
        }

@m13v m13v closed this Feb 23, 2026
@m13v m13v deleted the sync/desktop-20260222-171627 branch February 23, 2026 03:32
@github-actions
Copy link
Contributor

Hey @m13v 👋

Thank you so much for taking the time to contribute to Omi! We truly appreciate you putting in the effort to submit this pull request.

After careful review, we've decided not to merge this particular PR. Please don't take this personally — we genuinely try to merge as many contributions as possible, but sometimes we have to make tough calls based on:

  • Project standards — Ensuring consistency across the codebase
  • User needs — Making sure changes align with what our users need
  • Code best practices — Maintaining code quality and maintainability
  • Project direction — Keeping aligned with our roadmap and vision

Your contribution is still valuable to us, and we'd love to see you contribute again in the future! If you'd like feedback on how to improve this PR or want to discuss alternative approaches, please don't hesitate to reach out.

Thank you for being part of the Omi community! 💜

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant