-
Notifications
You must be signed in to change notification settings - Fork 5
Remove max convos limit #301
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Claude finished @yewreeka's task —— View job Code Review Complete ✅I've completed a comprehensive review of PR #301. This is a significant architectural change that removes the max conversation limit by introducing an inbox lifecycle management system. Overall, the implementation is well-structured with good test coverage, but there are several important issues to address. 🎯 Architecture & DesignStrengths
Concerns
🐛 Critical Bugs & Issues1. Race Condition in ConversationsViewModel.swift:92-95Task { [weak self] in
guard let self else { return }
await session.setActiveClientId(self.selectedConversation?.clientId)
}Issue: The async task can execute out of order if selection changes rapidly. The Fix: Check that selection hasn't changed before setting: Task { [weak self] in
guard let self else { return }
guard self._selectedConversationId == conversation.id else { return }
await session.setActiveClientId(conversation.clientId)
}Reference: ConversationsViewModel.swift:92-95 2. Inconsistent Selection State on Error (ConversationsViewModel.swift:72)When Fix: Clear selection on error: } catch {
Log.error("Failed to create conversation view model: \(error)")
self.selectedConversationViewModel = nil
self._selectedConversationId = nil
}3. Memory Leak in SleepingInboxMessageChecker.swift:70-76The periodic check task captures periodicCheckTask = Task { [weak self] in
while !Task.isCancelled {
try? await Task.sleep(for: .seconds(self?.checkInterval ?? 60))
guard !Task.isCancelled else { break }
await self?.checkNow() // no-op when self is nil
}
}Fix: Break when self becomes nil: while !Task.isCancelled {
guard let self else { break }
try? await Task.sleep(for: .seconds(self.checkInterval))
guard !Task.isCancelled else { break }
await self.checkNow()
}Reference: SleepingInboxMessageChecker.swift:70-76 4. Thread Safety Issue in PendingInviteRepository.swift:128public final class MockPendingInviteRepository: PendingInviteRepositoryProtocol, @unchecked Sendable {
public var pendingInvites: [PendingInviteInfo] = []
Issue: Fix: Make it an public actor MockPendingInviteRepository: PendingInviteRepositoryProtocol {
public var pendingInvites: [PendingInviteInfo] = []
Reference: PendingInviteRepository.swift:128 5. Identifiable Violation in PendingInviteRepository.swift:6public var id: String { clientId }Issue: Results are grouped by Fix: Use both fields: public var id: String { "\(clientId)|\(inboxId)" }Reference: PendingInviteRepository.swift:6
|
How to use the Graphite Merge QueueAdd the label merge-queue to this PR to add it to the merge queue. You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
Remove conversation cap and route inbox lifecycle to
|
ConvosCore/Sources/ConvosCore/Storage/Repositories/PendingInviteRepository.swift
Show resolved
Hide resolved
ConvosCore/Sources/ConvosCore/Inboxes/InboxLifecycleManager.swift
Outdated
Show resolved
Hide resolved
ConvosCore/Sources/ConvosCore/Inboxes/MessagingService+PushNotifications.swift
Show resolved
Hide resolved
ConvosCore/Sources/ConvosCore/Inboxes/InboxLifecycleManager.swift
Outdated
Show resolved
Hide resolved
ConvosCore/Sources/ConvosCore/Inboxes/MessagingService+PushNotifications.swift
Show resolved
Hide resolved
ConvosCore/Sources/ConvosCore/Inboxes/MessagingService+PushNotifications.swift
Show resolved
Hide resolved
15d553a to
0bd2cab
Compare
ConvosCore/Sources/ConvosCore/Inboxes/MessagingService+PushNotifications.swift
Show resolved
Hide resolved
ConvosCore/Sources/ConvosCore/Inboxes/InboxLifecycleManager.swift
Outdated
Show resolved
Hide resolved
ConvosCore/Sources/ConvosCore/Inboxes/InboxLifecycleManager.swift
Outdated
Show resolved
Hide resolved
ConvosCore/Sources/ConvosCore/Inboxes/SleepingInboxMessageChecker.swift
Outdated
Show resolved
Hide resolved
ConvosCore/Sources/ConvosCore/Storage/Repositories/PendingInviteRepository.swift
Show resolved
Hide resolved
ConvosCore/Sources/ConvosCore/Inboxes/InboxLifecycleManager.swift
Outdated
Show resolved
Hide resolved
ConvosCore/Sources/ConvosCore/Inboxes/SleepingInboxMessageChecker.swift
Outdated
Show resolved
Hide resolved
Merge activity
|
9ce42ef to
f42b684
Compare
e995465 to
c6cdef1
Compare
First pass at inbox lifecycle manager to remove max convos limit wake clients for push notifs when app is active
c6cdef1 to
88925ce
Compare

First pass at inbox lifecycle manager to remove max convos limit
wake clients for push notifs when app is active