Skip to content

Commit

Permalink
[RFR-772] Ignore sync errors from background (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
hb0 authored Sep 25, 2023
1 parent b294cb0 commit d5e1f43
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 20 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ ext {
*/

// Cyface dependencies
cyfaceAndroidBackendVersion = "7.9.2" // Also update submodule commit ref
cyfaceAndroidBackendVersion = "7.9.3" // Also update submodule commit ref
cyfaceUtilsVersion = "4.0.4"
cyfaceEnergySettingsVersion = "4.0.3" // Also update submodule commit ref
cyfaceCameraServiceVersion = "4.3.5" // Also update submodule commit ref
Expand Down
14 changes: 8 additions & 6 deletions ui/cyface/src/main/kotlin/de/cyface/app/MeasuringClient.kt
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,15 @@ class MeasuringClient : Application() {
* Reports error events to the user via UI and to Sentry, if opted-in.
*/
private val errorListener =
ErrorHandler.ErrorListener { errorCode: ErrorCode, errorMessage: String ->
ErrorHandler.ErrorListener { errorCode, errorMessage, fromBackground ->
val appName = applicationContext.getString(R.string.app_name)
Toast.makeText(
this@MeasuringClient,
String.format("%s - %s", errorMessage, appName),
Toast.LENGTH_LONG
).show()
if (!fromBackground) { // RFR-772
Toast.makeText(
this@MeasuringClient,
String.format("%s - %s", errorMessage, appName),
Toast.LENGTH_LONG
).show()
}

// There are two cases we can have network errors
// 1. during authentication (AuthTokenRequest), either login or before upload
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,15 @@ class MeasuringClient : Application() {
* Reports error events to the user via UI and to Sentry, if opted-in.
*/
private val errorListener =
ErrorHandler.ErrorListener { errorCode: ErrorCode, errorMessage: String ->
ErrorHandler.ErrorListener { errorCode, errorMessage, fromBackground ->
val appName = applicationContext.getString(R.string.app_name)
Toast.makeText(
this@MeasuringClient,
String.format("%s - %s", errorMessage, appName),
Toast.LENGTH_LONG
).show()
if (!fromBackground) { // RFR-772
Toast.makeText(
this@MeasuringClient,
String.format("%s - %s", errorMessage, appName),
Toast.LENGTH_LONG
).show()
}

// There are two cases we can have network errors
// 1. during authentication (AuthTokenRequest), either login or before upload
Expand Down
14 changes: 8 additions & 6 deletions ui/r4r/src/main/kotlin/de/cyface/app/r4r/Application.kt
Original file line number Diff line number Diff line change
Expand Up @@ -57,13 +57,15 @@ class Application : Application() {
* Reports error events to the user via UI and to Sentry, if opted-in.
*/
private val errorListener =
ErrorHandler.ErrorListener { errorCode: ErrorCode, errorMessage: String ->
ErrorHandler.ErrorListener { errorCode, errorMessage, fromBackground ->
val appName = applicationContext.getString(R.string.app_name)
Toast.makeText(
this@Application,
String.format("%s - %s", errorMessage, appName),
Toast.LENGTH_LONG
).show()
if (!fromBackground) { // RFR-772
Toast.makeText(
this@Application,
String.format("%s - %s", errorMessage, appName),
Toast.LENGTH_LONG
).show()
}

// There are two cases we can have network errors
// 1. during authentication (AuthTokenRequest), either login or before upload
Expand Down

0 comments on commit d5e1f43

Please sign in to comment.