Skip to content

Commit 6112df7

Browse files
committed
Drop unused SyncCrypto dependency from DuckChatSyncDataManager
The encryption hook was injected to wrap the chat title for outgoing PATCHes, but the title was dropped from the wire payload when rename sync was deferred to the JWE work. SyncCrypto wraps with the sync master key — the wrong algorithm for ai_chats titles anyway — so the follow-up rename work will bring its own primitives. Remove the constructor param, the test mock, the unused stub, and the orphaned imports.
1 parent 9de2684 commit 6112df7

2 files changed

Lines changed: 0 additions & 7 deletions

File tree

duckchat/duckchat-impl/src/main/java/com/duckduckgo/duckchat/impl/sync/DuckChatSyncDataManager.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ import com.duckduckgo.duckchat.impl.feature.DuckChatFeature
2727
import com.duckduckgo.duckchat.impl.repository.DuckChatFeatureRepository
2828
import com.duckduckgo.duckchat.impl.sync.DuckChatSyncDataManager.Adapters.Companion.patchResponseAdapter
2929
import com.duckduckgo.duckchat.store.impl.DuckAiChatStore
30-
import com.duckduckgo.sync.api.SyncCrypto
3130
import com.duckduckgo.sync.api.engine.DeletableDataManager
3231
import com.duckduckgo.sync.api.engine.DeletableType
3332
import com.duckduckgo.sync.api.engine.ModifiedSince
@@ -65,7 +64,6 @@ class DuckChatSyncDataManager @Inject constructor(
6564
private val duckChatFeature: DuckChatFeature,
6665
@AppCoroutineScope private val appCoroutineScope: CoroutineScope,
6766
private val duckAiChatStore: DuckAiChatStore,
68-
private val syncCrypto: SyncCrypto,
6967
) : DeletableDataManager, SyncableDataProvider, SyncableDataPersister {
7068

7169
override fun getDeletableType(): DeletableType = DeletableType.DUCK_AI_CHATS

duckchat/duckchat-impl/src/test/java/com/duckduckgo/duckchat/impl/sync/DuckChatSyncDataManagerTest.kt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import com.duckduckgo.duckchat.store.impl.DuckAiChat
2525
import com.duckduckgo.duckchat.store.impl.DuckAiChatStore
2626
import com.duckduckgo.feature.toggles.api.FakeFeatureToggleFactory
2727
import com.duckduckgo.feature.toggles.api.Toggle
28-
import com.duckduckgo.sync.api.SyncCrypto
2928
import com.duckduckgo.sync.api.engine.DeletableType
3029
import com.duckduckgo.sync.api.engine.FeatureSyncError
3130
import com.duckduckgo.sync.api.engine.SyncChangesResponse
@@ -61,8 +60,6 @@ class DuckChatSyncDataManagerTest {
6160

6261
private val duckAiChatStore: DuckAiChatStore = mock()
6362

64-
private val syncCrypto: SyncCrypto = mock()
65-
6663
private lateinit var testee: DuckChatSyncDataManager
6764

6865
private val duckChatFeature = FakeFeatureToggleFactory.create(DuckChatFeature::class.java)
@@ -72,7 +69,6 @@ class DuckChatSyncDataManagerTest {
7269
whenever(duckChatFeatureRepository.isAIChatHistoryEnabled()).thenReturn(true)
7370
whenever(duckChatSyncRepository.getPendingChatDeletions()).thenReturn(emptySet())
7471
whenever(duckChatSyncRepository.getPendingChatUpdates()).thenReturn(emptySet())
75-
whenever(syncCrypto.encrypt(any<String>())).thenAnswer { "ENC:${it.arguments[0]}" }
7672
testee = DuckChatSyncDataManager(
7773
duckChatSyncRepository = duckChatSyncRepository,
7874
duckChatFeatureRepository = duckChatFeatureRepository,
@@ -81,7 +77,6 @@ class DuckChatSyncDataManagerTest {
8177
duckChatFeature = duckChatFeature,
8278
appCoroutineScope = coroutineTestRule.testScope,
8379
duckAiChatStore = duckAiChatStore,
84-
syncCrypto = syncCrypto,
8580
)
8681
}
8782

0 commit comments

Comments
 (0)