Skip to content

Commit

Permalink
User TImber instead of LogsManager directly (#4140)
Browse files Browse the repository at this point in the history
  • Loading branch information
david-livefront authored Oct 23, 2024
1 parent a23fc31 commit 79ebd2b
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import com.x8bit.bitwarden.data.autofill.processor.AutofillProcessor
import com.x8bit.bitwarden.data.autofill.processor.AutofillProcessorImpl
import com.x8bit.bitwarden.data.autofill.provider.AutofillCipherProvider
import com.x8bit.bitwarden.data.autofill.provider.AutofillCipherProviderImpl
import com.x8bit.bitwarden.data.platform.manager.LogsManager
import com.x8bit.bitwarden.data.platform.manager.PolicyManager
import com.x8bit.bitwarden.data.platform.manager.ciphermatching.CipherMatchingManager
import com.x8bit.bitwarden.data.platform.manager.clipboard.BitwardenClipboardManager
Expand Down Expand Up @@ -121,7 +120,6 @@ object AutofillModule {
policyManager: PolicyManager,
saveInfoBuilder: SaveInfoBuilder,
settingsRepository: SettingsRepository,
logsManager: LogsManager,
): AutofillProcessor =
AutofillProcessorImpl(
dispatcherManager = dispatcherManager,
Expand All @@ -131,7 +129,6 @@ object AutofillModule {
policyManager = policyManager,
saveInfoBuilder = saveInfoBuilder,
settingsRepository = settingsRepository,
logsManager = logsManager,
)

@Singleton
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ import com.x8bit.bitwarden.data.autofill.model.AutofillRequest
import com.x8bit.bitwarden.data.autofill.parser.AutofillParser
import com.x8bit.bitwarden.data.autofill.util.createAutofillSavedItemIntentSender
import com.x8bit.bitwarden.data.autofill.util.toAutofillSaveItem
import com.x8bit.bitwarden.data.platform.manager.LogsManager
import com.x8bit.bitwarden.data.platform.manager.PolicyManager
import com.x8bit.bitwarden.data.platform.manager.dispatcher.DispatcherManager
import com.x8bit.bitwarden.data.platform.repository.SettingsRepository
import com.x8bit.bitwarden.data.vault.datasource.network.model.PolicyTypeJson
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Job
import kotlinx.coroutines.launch
import timber.log.Timber

/**
* The default implementation of [AutofillProcessor]. Its purpose is to handle autofill related
Expand All @@ -35,7 +35,6 @@ class AutofillProcessorImpl(
private val parser: AutofillParser,
private val saveInfoBuilder: SaveInfoBuilder,
private val settingsRepository: SettingsRepository,
private val logsManager: LogsManager,
) : AutofillProcessor {

/**
Expand Down Expand Up @@ -146,7 +145,7 @@ class AutofillProcessorImpl(
} catch (e: RuntimeException) {
// This is to catch any TransactionTooLargeExceptions that could occur here.
// These exceptions get wrapped as a RuntimeException.
logsManager.trackNonFatalException(e)
Timber.e(e, "Autofill Error")
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import com.x8bit.bitwarden.data.autofill.parser.AutofillParser
import com.x8bit.bitwarden.data.autofill.util.createAutofillSavedItemIntentSender
import com.x8bit.bitwarden.data.autofill.util.toAutofillSaveItem
import com.x8bit.bitwarden.data.platform.base.FakeDispatcherManager
import com.x8bit.bitwarden.data.platform.manager.LogsManager
import com.x8bit.bitwarden.data.platform.manager.PolicyManager
import com.x8bit.bitwarden.data.platform.repository.SettingsRepository
import com.x8bit.bitwarden.data.vault.datasource.network.model.PolicyTypeJson
Expand Down Expand Up @@ -57,7 +56,6 @@ class AutofillProcessorTest {
private val policyManager: PolicyManager = mockk()
private val saveInfoBuilder: SaveInfoBuilder = mockk()
private val settingsRepository: SettingsRepository = mockk()
private val logsManager: LogsManager = mockk()

private val appInfo: AutofillAppInfo = AutofillAppInfo(
context = mockk(),
Expand All @@ -79,7 +77,6 @@ class AutofillProcessorTest {
policyManager = policyManager,
saveInfoBuilder = saveInfoBuilder,
settingsRepository = settingsRepository,
logsManager = logsManager,
)
}

Expand Down Expand Up @@ -246,7 +243,6 @@ class AutofillProcessorTest {
} returns fillResponse
val runtimeException = RuntimeException("TransactionToLarge")
every { fillCallback.onSuccess(fillResponse) } throws runtimeException
every { logsManager.trackNonFatalException(runtimeException) } just runs

// Test
autofillProcessor.processFillRequest(
Expand All @@ -271,7 +267,6 @@ class AutofillProcessorTest {
saveInfo = saveInfo,
)
fillCallback.onSuccess(fillResponse)
logsManager.trackNonFatalException(runtimeException)
}
}

Expand Down

0 comments on commit 79ebd2b

Please sign in to comment.