Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ object JSONUtils {
try {
val value = jsonObject.opt(key)
if (value is JSONArray || value is JSONObject) {
Logging.error("Omitting key '$key'! sendTags DO NOT supported nested values!")
Logging.warn("Omitting key '$key'! sendTags DO NOT supported nested values!")
} else if (jsonObject.isNull(key) || "" == value) {
result[key] = ""
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ internal class BackgroundManager(
} catch (e: NullPointerException) {
// Catch for buggy Oppo devices
// https://github.com/OneSignal/OneSignal-Android-SDK/issues/487
Logging.error(
Logging.info(
Comment thread
abdulraqeeb33 marked this conversation as resolved.
"scheduleSyncServiceAsJob called JobScheduler.jobScheduler which " +
"triggered an internal null Android error. Skipping job.",
e,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ internal class HttpClient(
return@withTimeout makeRequestIODispatcher(url, method, jsonBody, timeout, headers)
}
} catch (e: TimeoutCancellationException) {
Logging.error("HttpClient: Request timed out: $url", e)
Logging.info("HttpClient: Request timed out: $url", e)
return HttpResponse(0, null, e)
} catch (e: Throwable) {
return HttpResponse(0, null, e)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ internal class OperationRepo(
ExecutionResult.FAIL_NORETRY,
ExecutionResult.FAIL_CONFLICT,
-> {
Logging.error("Operation execution failed without retry: $operations")
Logging.warn("Operation execution failed without retry: $operations")
// on failure we remove the operation from the store and wake any waiters
ops.forEach { _operationModelStore.remove(it.operation.id) }
ops.forEach { it.waiter?.wake(false) }
Expand All @@ -287,7 +287,7 @@ internal class OperationRepo(
}
}
ExecutionResult.FAIL_RETRY -> {
Logging.error("Operation execution failed, retrying: $operations")
Logging.info("Operation execution failed, retrying: $operations")
// add back all operations to the front of the queue to be re-executed.
synchronized(queue) {
ops.reversed().forEach {
Expand Down Expand Up @@ -349,7 +349,7 @@ internal class OperationRepo(
val delayForOnRetries = retries * _configModelStore.model.opRepoDefaultFailRetryBackoff
val delayFor = max(delayForOnRetries, retryAfterSecondsNonNull * 1_000)
if (delayFor < 1) return
Logging.error("Operations being delay for: $delayFor ms")
Logging.debug("Operations being delay for: $delayFor ms")
withTimeoutOrNull(delayFor) {
retryWaiter.waitForWake()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ internal class OutcomeEventsController(
val err = "OutcomeEventsController.sendSavedOutcomeEvent: Sending outcome with name: ${event.outcomeId} failed with status code: ${ex.statusCode} and response: ${ex.response}"

if (responseType == NetworkUtils.ResponseStatusType.RETRYABLE) {
Logging.warn("$err Outcome event was cached and will be reattempted on app cold start")
Logging.info("$err Outcome event was cached and will be reattempted on app cold start")
} else {
Logging.error("$err Outcome event will be omitted!")
Logging.warn("$err Outcome event will be omitted!")
_outcomeEventsCache.deleteOldOutcomeEvent(event)
}
}
Expand Down Expand Up @@ -229,13 +229,13 @@ internal class OutcomeEventsController(
val err = "OutcomeEventsController.sendAndCreateOutcomeEvent: Sending outcome with name: $name failed with status code: ${ex.statusCode} and response: ${ex.response}"

if (responseType == NetworkUtils.ResponseStatusType.RETRYABLE) {
Logging.warn("$err Outcome event was cached and will be reattempted on app cold start")
Logging.info("$err Outcome event was cached and will be reattempted on app cold start")

// Only if we need to save and retry the outcome, then we will save the timestamp for future sending
eventParams.timestamp = timestampSeconds
_outcomeEventsCache.saveOutcomeEvent(eventParams)
} else {
Logging.error("$err Outcome event will be omitted!")
Logging.warn("$err Outcome event will be omitted!")
_outcomeEventsCache.deleteOldOutcomeEvent(eventParams)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ internal class SessionListener(

// Time is erroneous if below 1 second or over a day
if (durationInSeconds < 1L || durationInSeconds > SECONDS_IN_A_DAY) {
Logging.error("SessionListener.onSessionEnded sending duration of $durationInSeconds seconds")
Logging.info("SessionListener.onSessionEnded sending duration of $durationInSeconds seconds")
}

_operationRepo.enqueue(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class LoginHelper(
)

if (!result) {
Logging.error("Could not login user")
Logging.warn("Could not login user")
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ internal class InAppBackendService(
statusCode: Int,
response: String?,
) {
Logging.error("Encountered a $statusCode error while attempting in-app message $requestType request: $response")
Logging.info("Encountered a $statusCode error while attempting in-app message $requestType request: $response")
}

private suspend fun attemptFetchWithRetries(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ internal class InAppDisplayer(
} catch (e: Exception) {
// Need to check error message to only catch MissingWebViewPackageException as it isn't public
if (e.message != null && e.message!!.contains("No WebView installed")) {
Logging.error("Error setting up WebView: ", e)
Logging.info("Error setting up WebView: ", e)
} else {
throw e
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ internal class InAppMessageView(
*/
suspend fun dismissAndAwaitNextMessage() {
if (draggableRelativeLayout == null) {
Logging.error("No host presenter to trigger dismiss animation, counting as dismissed already")
Logging.info("No host presenter to trigger dismiss animation, counting as dismissed already")
dereferenceViews()
return
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ internal class InAppHydrator(
try {
val content = InAppMessageContent(jsonObject)
if (content.contentHtml == null) {
Logging.debug("displayMessage:OnSuccess: No HTML retrieved from loadMessageContent")
Logging.info("displayMessage:OnSuccess: No HTML retrieved from loadMessageContent")
Copy link

Copilot AI Jan 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changing this log from Logging.debug to Logging.info may be unnecessary. This appears to be a normal case where HTML content is not available (not an error condition), and debug level seems more appropriate for such operational details. Consider reverting to debug to avoid cluttering info logs with normal flow conditions.

Suggested change
Logging.info("displayMessage:OnSuccess: No HTML retrieved from loadMessageContent")
Logging.debug("displayMessage:OnSuccess: No HTML retrieved from loadMessageContent")

Copilot uses AI. Check for mistakes.
return null
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ internal class LocationManager(
if (androidSDKInt < Build.VERSION_CODES.M) {
if (!hasFinePermissionGranted && !hasCoarsePermissionGranted) {
// Permission missing on manifest
Logging.error("Location permissions not added on AndroidManifest file < M")
Logging.info("Location permissions not added on AndroidManifest file < M")
return@withContext false
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ internal class HmsLocationController(
hmsFusedLocationClient =
com.huawei.hms.location.LocationServices.getFusedLocationProviderClient(_applicationService.appContext)
} catch (e: Exception) {
Logging.error("Huawei LocationServices getFusedLocationProviderClient failed! $e")
Logging.warn("Huawei LocationServices getFusedLocationProviderClient failed! $e")
wasSuccessful = false
return@withLock
}
Expand All @@ -75,7 +75,7 @@ internal class HmsLocationController(
},
)
.addOnFailureListener { e ->
Logging.error("Huawei LocationServices getLastLocation failed!", e)
Logging.warn("Huawei LocationServices getLastLocation failed!", e)
waiter.wake(false)
}
wasSuccessful = waiter.waitForWake()
Expand Down Expand Up @@ -133,7 +133,7 @@ internal class HmsLocationController(
},
)
.addOnFailureListener { e ->
Logging.error("Huawei LocationServices getLastLocation failed!", e)
Logging.warn("Huawei LocationServices getLastLocation failed!", e)
waiter.wake()
}
waiter.waitForWake()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ object OneSignalHmsEventBridge {

data = messageDataJSON.toString()
} catch (e: JSONException) {
Logging.error("OneSignalHmsEventBridge error when trying to create RemoteMessage data JSON")
Logging.warn("OneSignalHmsEventBridge error when trying to create RemoteMessage data JSON")
}

// HMS notification with Message Type being Message won't trigger Activity reverse trampolining logic
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ internal class NotificationChannelManager(
ledColor = BigInteger(ledc, 16)
channel.lightColor = ledColor.toInt()
} catch (t: Throwable) {
Logging.error("Couldn't convert ARGB Hex value to BigInteger:", t)
Logging.warn("Couldn't convert ARGB Hex value to BigInteger:", t)
}
}
channel.enableLights(payload.optInt("led", 1) == 1)
Expand Down Expand Up @@ -211,7 +211,7 @@ internal class NotificationChannelManager(
} catch (e: NullPointerException) {
// Catch issue caused by "Attempt to invoke virtual method 'boolean android.app.NotificationChannel.isDeleted()' on a null object reference"
// https://github.com/OneSignal/OneSignal-Android-SDK/issues/1291
Logging.error("Error when trying to delete notification channel: " + e.message)
Logging.warn("Error when trying to delete notification channel: " + e.message)
}

// Delete old channels - Payload will include all changes for the app. Any extra OS_ ones must
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ object OSWorkManagerHelper {
This aims to catch the IllegalStateException "WorkManager is not initialized properly..." -
https://androidx.tech/artifacts/work/work-runtime/2.8.1-source/androidx/work/impl/WorkManagerImpl.java.html
*/
Logging.error("OSWorkManagerHelper.getInstance failed, attempting to initialize: ", e)
Logging.warn("OSWorkManagerHelper.getInstance failed, attempting to initialize: ", e)
initializeWorkManager(context)
WorkManager.getInstance(context)
}
Expand All @@ -51,7 +51,7 @@ object OSWorkManagerHelper {
1. We lost the race with another call to WorkManager.initialize outside of OneSignal.
2. It is possible for some other unexpected error is thrown from WorkManager.
*/
Logging.error("OSWorkManagerHelper initializing WorkManager failed: ", e)
Logging.warn("OSWorkManagerHelper initializing WorkManager failed: ", e)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ internal class NotificationRepository(
}
}
} catch (t: Throwable) {
Logging.error("Error clearing oldest notifications over limit! ", t)
Logging.warn("Error clearing oldest notifications over limit! ", t)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,9 @@ internal class NotificationGenerationProcessor(
}.join()
}
} catch (to: TimeoutCancellationException) {
Logging.error("remoteNotificationReceived timed out, continuing with wantsToDisplay=$wantsToDisplay.", to)
Logging.info("remoteNotificationReceived timed out, continuing with wantsToDisplay=$wantsToDisplay.", to)
} catch (t: Throwable) {
Logging.error("remoteNotificationReceived threw an exception. Displaying normal OneSignal notification.", t)
Logging.info("remoteNotificationReceived threw an exception. Displaying normal OneSignal notification.", t)
}

var shouldDisplay =
Expand Down Expand Up @@ -121,7 +121,7 @@ internal class NotificationGenerationProcessor(
} catch (to: TimeoutCancellationException) {
Logging.info("notificationWillShowInForegroundHandler timed out, continuing with wantsToDisplay=$wantsToDisplay.", to)
} catch (t: Throwable) {
Logging.error(
Logging.info(
Copy link

Copilot AI Jan 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Downgrading callback exception handling from Logging.error to Logging.info is questionable. When a developer's callback throws an exception (remoteNotificationReceived or notificationWillShowInForegroundHandler), this represents a bug in the developer's code that they should be notified about. Consider keeping this at Logging.error or using Logging.warn to ensure developers are aware of issues in their notification handling code.

Suggested change
Logging.info(
Logging.warn(

Copilot uses AI. Check for mistakes.
"notificationWillShowInForegroundHandler threw an exception. Displaying normal OneSignal notification.",
t,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,9 @@ internal class NotificationLifecycleService(
},
onError = { ex ->
if (ex is BackendException) {
Logging.error("Notification opened confirmation failed with statusCode: ${ex.statusCode} response: ${ex.response}")
Logging.info("Notification opened confirmation failed with statusCode: ${ex.statusCode} response: ${ex.response}")
} else {
Logging.error("Unexpected error in notification opened confirmation", ex)
Logging.info("Unexpected error in notification opened confirmation", ex)
Comment on lines +158 to +160
Copy link

Copilot AI Jan 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Downgrading notification opened confirmation failures from Logging.error to Logging.info may be too severe. While this is a non-critical backend operation that can fail, it represents a loss of analytics data that developers may want to be alerted about. Consider using Logging.warn instead to maintain better visibility while still reducing log volume.

Copilot uses AI. Check for mistakes.
}
},
)
Expand Down Expand Up @@ -275,22 +275,19 @@ internal class NotificationLifecycleService(

val intent = intentGenerator.getIntentVisible()
if (intent != null) {
Logging.info("SDK running startActivity with Intent: $intent")
Logging.debug("SDK running startActivity with Intent: $intent")
withContext(Dispatchers.Main) {
activity.startActivity(intent)
}
} else {
Logging.info("SDK not showing an Activity automatically due to it's settings.")
Logging.debug("SDK not showing an Activity automatically due to it's settings.")
}
} catch (e: JSONException) {
Logging.error("Could not parse JSON to open notification activity.")
e.printStackTrace()
Logging.error("Could not parse JSON to open notification activity.", e)
Comment thread
jkasten2 marked this conversation as resolved.
} catch (e: ActivityNotFoundException) {
Logging.error("No activity found to handle notification open intent.")
e.printStackTrace()
Logging.warn("No activity found to handle notification open intent.", e)
} catch (e: Exception) {
Logging.error("Could not open notification activity.")
e.printStackTrace()
Logging.error("Could not open notification activity.", e)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ internal class PushTokenManager(
override suspend fun retrievePushToken(): PushTokenResponse {
when (_deviceService.jetpackLibraryStatus) {
IDeviceService.JetpackLibraryStatus.MISSING -> {
Logging.fatal("Could not find the Jetpack/AndroidX. Please make sure it has been correctly added to your project.")
Logging.info("Could not find the Jetpack/AndroidX. Please make sure it has been correctly added to your project.")
Copy link

Copilot AI Jan 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Downgrading from Logging.fatal to Logging.info for missing Jetpack/AndroidX library may be too severe a reduction. This is a critical configuration issue that prevents push notifications from working entirely. Consider using Logging.warn instead to maintain visibility of this important configuration problem while still reducing log volume.

Suggested change
Logging.info("Could not find the Jetpack/AndroidX. Please make sure it has been correctly added to your project.")
Logging.warn("Could not find the Jetpack/AndroidX. Please make sure it has been correctly added to your project.")

Copilot uses AI. Check for mistakes.
pushTokenStatus = SubscriptionStatus.MISSING_JETPACK_LIBRARY
}
IDeviceService.JetpackLibraryStatus.OUTDATED -> {
Logging.fatal(
Logging.info(
Copy link

Copilot AI Jan 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Downgrading from Logging.fatal to Logging.info for outdated Jetpack/AndroidX library may be too severe a reduction. This is a critical configuration issue that prevents push notifications from working entirely. Consider using Logging.warn instead to maintain visibility of this important configuration problem while still reducing log volume.

Suggested change
Logging.info(
Logging.warn(

Copilot uses AI. Check for mistakes.
"The included Jetpack/AndroidX Library is too old or incomplete.",
)
pushTokenStatus = SubscriptionStatus.OUTDATED_JETPACK_LIBRARY
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ internal class ReceiveReceiptProcessor(
try {
_backend.updateNotificationAsReceived(appId, notificationId, subscriptionId, deviceType)
} catch (ex: BackendException) {
Logging.error("Receive receipt failed with statusCode: ${ex.statusCode} response: ${ex.response}")
Logging.info("Receive receipt failed with statusCode: ${ex.statusCode} response: ${ex.response}")
Copy link

Copilot AI Jan 27, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Downgrading receive receipt backend failures from Logging.error to Logging.info may hide important analytics issues. While receipt confirmation is non-critical for app functionality, consistent failures could indicate backend or configuration problems. Consider using Logging.warn instead to maintain visibility of these issues while reducing log volume.

Suggested change
Logging.info("Receive receipt failed with statusCode: ${ex.statusCode} response: ${ex.response}")
Logging.warn("Receive receipt failed with statusCode: ${ex.statusCode} response: ${ex.response}")

Copilot uses AI. Check for mistakes.
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ internal class PushRegistratorADM(

result =
if (registrationId != null) {
Logging.error("ADM registered with ID:$registrationId")
Logging.debug("ADM registered with ID:$registrationId")
IPushRegistrator.RegisterResult(
registrationId,
SubscriptionStatus.SUBSCRIBED,
)
} else {
Logging.error("com.onesignal.ADMMessageHandler timed out, please check that your have the receiver, service, and your package name matches(NOTE: Case Sensitive) per the OneSignal instructions.")
Logging.info("com.onesignal.ADMMessageHandler timed out, please check that your have the receiver, service, and your package name matches(NOTE: Case Sensitive) per the OneSignal instructions.")
IPushRegistrator.RegisterResult(
null,
SubscriptionStatus.ERROR,
Expand Down
Loading
Loading