diff --git a/komga/build.gradle.kts b/komga/build.gradle.kts index da48e4e5b..e74e707a2 100644 --- a/komga/build.gradle.kts +++ b/komga/build.gradle.kts @@ -11,7 +11,6 @@ plugins { kotlin("plugin.spring") kotlin("kapt") } - // 3.1.3+ breaks SSE - https://github.com/spring-projects/spring-framework/issues/31140 id("org.springframework.boot") version "3.1.2" id("com.gorylenko.gradle-git-properties") version "2.4.1" id("nu.studer.jooq") version "8.2.1" diff --git a/komga/src/main/kotlin/org/gotson/komga/interfaces/sse/SseController.kt b/komga/src/main/kotlin/org/gotson/komga/interfaces/sse/SseController.kt index 6520d58b9..e14b75897 100644 --- a/komga/src/main/kotlin/org/gotson/komga/interfaces/sse/SseController.kt +++ b/komga/src/main/kotlin/org/gotson/komga/interfaces/sse/SseController.kt @@ -50,7 +50,8 @@ class SseController( if (!acceptingConnections) throw IllegalStateException("Server is shutting down, not accepting new SSE connections") val emitter = SseEmitter() emitter.onCompletion { synchronized(emitters) { emitters.remove(emitter) } } - emitter.onTimeout { emitter.complete() } + emitter.onTimeout { synchronized(emitters) { emitters.remove(emitter) } } + emitter.onError { synchronized(emitters) { emitters.remove(emitter) } } emitters[emitter] = principal.user return emitter }