Skip to content

Commit 2634d0e

Browse files
authored
Merge pull request #1710 from Infomaniak/quota-sentry
Remove Sentry about negative Quota
2 parents d81447b + 2d40b85 commit 2634d0e

File tree

2 files changed

+2
-17
lines changed

2 files changed

+2
-17
lines changed

app/src/main/java/com/infomaniak/mail/data/models/Quotas.kt

+1-16
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ import android.content.Context
2121
import android.text.format.Formatter
2222
import com.infomaniak.mail.R
2323
import io.realm.kotlin.types.EmbeddedRealmObject
24-
import io.sentry.Sentry
25-
import io.sentry.SentryLevel
2624
import kotlinx.serialization.SerialName
2725
import kotlinx.serialization.Serializable
2826
import kotlin.math.ceil
@@ -39,24 +37,11 @@ class Quotas : EmbeddedRealmObject {
3937
return converted * 1_000L // Convert from KiloOctets to Octets
4038
}
4139

42-
fun getText(context: Context, email: String?): String {
40+
fun getText(context: Context): String {
4341

4442
val usedSize = Formatter.formatShortFileSize(context, size)
4543
val maxSize = Formatter.formatShortFileSize(context, QUOTAS_MAX_SIZE)
4644

47-
// TODO: Remove this Sentry when we are sure the fix is the right one.
48-
if (_size < 0L || size < 0L || usedSize.firstOrNull() == '-') {
49-
Sentry.withScope { scope ->
50-
scope.level = SentryLevel.WARNING
51-
scope.setExtra("1. mailbox", "$email")
52-
scope.setExtra("2. raw size", "$_size")
53-
scope.setExtra("3. display size", usedSize)
54-
scope.setExtra("4. raw maxSize", "$QUOTAS_MAX_SIZE")
55-
scope.setExtra("5. display maxSize", maxSize)
56-
Sentry.captureMessage("Quotas: Something is negative when trying to display")
57-
}
58-
}
59-
6045
return context.getString(R.string.menuDrawerMailboxStorage, usedSize, maxSize)
6146
}
6247

app/src/main/java/com/infomaniak/mail/ui/main/menu/MenuDrawerFragment.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ class MenuDrawerFragment : MenuFoldersFragment(), MailboxListFragment {
305305
storageDivider.isVisible = isLimited
306306

307307
if (isLimited) {
308-
storageText.text = quotas!!.getText(context, mainViewModel.currentMailbox.value?.email)
308+
storageText.text = quotas!!.getText(context)
309309
storageIndicator.progress = quotas.getProgress()
310310
}
311311
}

0 commit comments

Comments
 (0)