Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
fix: call updateNotificationAsOpened in a destinate coroutine scope
  • Loading branch information
jinliu9508 committed May 22, 2025
commit 817a9cfe6269617a6636410f95c7f74ca2fe73e9
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import com.onesignal.common.JSONUtils
import com.onesignal.common.events.CallbackProducer
import com.onesignal.common.events.EventProducer
import com.onesignal.common.exceptions.BackendException
import com.onesignal.common.threading.OSPrimaryCoroutineScope
import com.onesignal.core.internal.application.AppEntryAction
import com.onesignal.core.internal.application.IApplicationService
import com.onesignal.core.internal.config.ConfigModelStore
Expand Down Expand Up @@ -138,15 +139,17 @@ internal class NotificationLifecycleService(

postedOpenedNotifIds.add(notificationId)

try {
_backend.updateNotificationAsOpened(
appId,
notificationId,
subscriptionId,
deviceType,
)
} catch (ex: BackendException) {
Logging.error("Notification opened confirmation failed with statusCode: ${ex.statusCode} response: ${ex.response}")
OSPrimaryCoroutineScope.execute {
try {
_backend.updateNotificationAsOpened(
appId,
notificationId,
subscriptionId,
deviceType,
)
} catch (ex: BackendException) {
Logging.error("Notification opened confirmation failed with statusCode: ${ex.statusCode} response: ${ex.response}")
}
}
}

Expand Down
Loading