diff --git a/server/src/main/kotlin/suwayomi/tachidesk/graphql/server/subscriptions/ApolloSubscriptionProtocolHandler.kt b/server/src/main/kotlin/suwayomi/tachidesk/graphql/server/subscriptions/ApolloSubscriptionProtocolHandler.kt index c18de81e..fcccac79 100644 --- a/server/src/main/kotlin/suwayomi/tachidesk/graphql/server/subscriptions/ApolloSubscriptionProtocolHandler.kt +++ b/server/src/main/kotlin/suwayomi/tachidesk/graphql/server/subscriptions/ApolloSubscriptionProtocolHandler.kt @@ -112,7 +112,7 @@ class ApolloSubscriptionProtocolHandler( return subscriptionHandler.executeSubscription(request, graphQLContext) .map { if (it.errors?.isNotEmpty() == true) { - SubscriptionOperationMessage(type = GQL_ERROR.type, id = operationMessage.id, payload = it) + SubscriptionOperationMessage(type = GQL_ERROR.type, id = operationMessage.id, payload = it.errors) } else { SubscriptionOperationMessage(type = GQL_NEXT.type, id = operationMessage.id, payload = it) } diff --git a/server/src/main/kotlin/suwayomi/tachidesk/manga/impl/download/DownloadManager.kt b/server/src/main/kotlin/suwayomi/tachidesk/manga/impl/download/DownloadManager.kt index d7a9c9e5..3df9c602 100644 --- a/server/src/main/kotlin/suwayomi/tachidesk/manga/impl/download/DownloadManager.kt +++ b/server/src/main/kotlin/suwayomi/tachidesk/manga/impl/download/DownloadManager.kt @@ -132,12 +132,11 @@ object DownloadManager { } private fun notifyAllClients(immediate: Boolean = false) { + scope.launch { + notifyFlow.emit(Unit) + } if (immediate) { sendStatusToAllClients() - } else { - scope.launch { - notifyFlow.emit(Unit) - } } /*if (downloadChapter != null) { TODO GRAPHQL downloadSubscriptionSource.publish(downloadChapter)