@@ -173,10 +173,7 @@ object SentryDebug {
173
173
//
174
174
// Also added in ThreadListAdapter & ThreadController the 04/06/24.
175
175
fun sendEmptyThread (thread : Thread , message : String ) = with (thread) {
176
- Sentry .captureMessage(
177
- message,
178
- SentryLevel .ERROR ,
179
- ) { scope ->
176
+ Sentry .captureMessage(message, SentryLevel .ERROR ) { scope ->
180
177
scope.setExtra(" currentUserId" , " ${AccountUtils .currentUserId} " )
181
178
scope.setExtra(" currentMailboxEmail" , AccountUtils .currentMailboxEmail.toString())
182
179
scope.setExtra(" folderId" , folderId)
@@ -199,10 +196,7 @@ object SentryDebug {
199
196
mailbox : Mailbox ? = null,
200
197
throwable : Throwable ? = null,
201
198
) {
202
- Sentry .captureMessage(
203
- " Failed Notif : $reason " ,
204
- sentryLevel,
205
- ) { scope ->
199
+ Sentry .captureMessage(" Failed Notif : $reason " , sentryLevel) { scope ->
206
200
scope.setExtra(" userId" , " ${userId?.toString()} " )
207
201
scope.setExtra(" currentUserId" , " [${AccountUtils .currentUserId} ]" )
208
202
scope.setExtra(" mailboxId" , " ${mailboxId?.toString()} " )
@@ -232,10 +226,7 @@ object SentryDebug {
232
226
fun sendOrphanMessages (previousCursor : String? , folder : Folder ): List <Message > {
233
227
val orphanMessages = folder.messages.filter { it.isOrphan() }
234
228
if (orphanMessages.isNotEmpty()) {
235
- Sentry .captureMessage(
236
- " We found some orphan Messages." ,
237
- SentryLevel .ERROR ,
238
- ) { scope ->
229
+ Sentry .captureMessage(" We found some orphan Messages." , SentryLevel .ERROR ) { scope ->
239
230
scope.setExtra(" orphanMessages" , " ${orphanMessages.map { it.uid }} " )
240
231
scope.setExtra(" number of Messages" , " ${orphanMessages.count()} " )
241
232
scope.setExtra(" previousCursor" , " $previousCursor " )
@@ -249,10 +240,7 @@ object SentryDebug {
249
240
fun sendOrphanThreads (previousCursor : String? , folder : Folder , realm : TypedRealm ): RealmResults <Thread > {
250
241
val orphanThreads = ThreadController .getOrphanThreads(realm)
251
242
if (orphanThreads.isNotEmpty()) {
252
- Sentry .captureMessage(
253
- " We found some orphan Threads." ,
254
- SentryLevel .ERROR ,
255
- ) { scope ->
243
+ Sentry .captureMessage(" We found some orphan Threads." , SentryLevel .ERROR ) { scope ->
256
244
scope.setExtra(" orphanThreads" , " ${orphanThreads.map { it.uid }} " )
257
245
scope.setExtra(" number of Threads" , " ${orphanThreads.count()} " )
258
246
scope.setExtra(" number of Messages" , " ${orphanThreads.map { it.messages.count() }} " )
@@ -266,10 +254,7 @@ object SentryDebug {
266
254
267
255
fun sendOrphanDrafts (orphans : List <Draft >) {
268
256
if (orphans.isNotEmpty()) {
269
- Sentry .captureMessage(
270
- " We found some orphan Drafts." ,
271
- SentryLevel .ERROR ,
272
- ) { scope ->
257
+ Sentry .captureMessage(" We found some orphan Drafts." , SentryLevel .ERROR ) { scope ->
273
258
scope.setExtra(
274
259
" orphanDrafts" ,
275
260
orphans.joinToString {
@@ -285,21 +270,15 @@ object SentryDebug {
285
270
}
286
271
287
272
fun sendOverScrolledMessage (clientWidth : Int , scrollWidth : Int , messageUid : String ) {
288
- Sentry .captureMessage(
289
- " When resizing the mail with js, after zooming, it can still scroll." ,
290
- SentryLevel .ERROR ,
291
- ) { scope ->
273
+ Sentry .captureMessage(" When resizing the mail with js, after zooming, it can still scroll." , SentryLevel .ERROR ) { scope ->
292
274
scope.setTag(" messageUid" , messageUid)
293
275
scope.setExtra(" clientWidth" , " $clientWidth " )
294
276
scope.setExtra(" scrollWidth" , " $scrollWidth " )
295
277
}
296
278
}
297
279
298
280
fun sendJavaScriptError (errorName : String , errorMessage : String , errorStack : String , messageUid : String ) {
299
- Sentry .captureMessage(
300
- " JavaScript returned an error when displaying an email." ,
301
- SentryLevel .ERROR ,
302
- ) { scope ->
281
+ Sentry .captureMessage(" JavaScript returned an error when displaying an email." , SentryLevel .ERROR ) { scope ->
303
282
scope.setTag(" messageUid" , messageUid)
304
283
scope.setExtra(" errorName" , errorName)
305
284
scope.setExtra(" errorMessage" , errorMessage)
@@ -315,10 +294,7 @@ object SentryDebug {
315
294
}
316
295
317
296
fun sendCredentialsIssue (infomaniakLogin : String? , infomaniakPassword : String ) {
318
- Sentry .captureMessage(
319
- " Credentials issue when trying to auto-sync user" ,
320
- SentryLevel .ERROR ,
321
- ) { scope ->
297
+ Sentry .captureMessage(" Credentials issue when trying to auto-sync user" , SentryLevel .ERROR ) { scope ->
322
298
scope.setExtra(" email" , " ${AccountUtils .currentUser?.email} " )
323
299
val loginStatus = when {
324
300
infomaniakLogin == null -> " is null"
@@ -337,7 +313,9 @@ object SentryDebug {
337
313
}
338
314
339
315
fun sendWebViewVersionName (webViewPackageName : String? , webViewVersionName : String? , majorVersion : Int ) {
340
- Sentry .captureMessage(" WebView version name might be null on some devices. Checking that the version name is ok." ) { scope ->
316
+ Sentry .captureMessage(
317
+ " WebView version name might be null on some devices. Checking that the version name is ok." ,
318
+ ) { scope ->
341
319
scope.setTag(" webViewPackageName" , " $webViewPackageName " )
342
320
scope.setTag(" webViewVersionName" , " $webViewVersionName " )
343
321
scope.setTag(" majorVersion" , " $majorVersion " )
0 commit comments