supabase-community / supabase-kt

A Kotlin Multiplatform Client for Supabase.
https://supabase.com/docs/reference/kotlin/introduction
MIT License
401 stars 37 forks source link

[Bug]: java.util.NoSuchElementException: #778

Open Shabinder opened 4 hours ago

Shabinder commented 4 hours ago

General Info

Version(s)

3.0.1

Kotlin Target(s) and their respective versions

Android 10,11,13,14

What happened? (include your code)

Realtime Related Crash.

  Fatal Exception: java.util.NoSuchElementException:
       at java.util.LinkedHashMap$LinkedHashIterator.nextNode(LinkedHashMap.java:762)
       at java.util.LinkedHashMap$LinkedEntryIterator.next(LinkedHashMap.java:792)
       at java.util.LinkedHashMap$LinkedEntryIterator.next(LinkedHashMap.java:790)
       at kotlin.collections.MapsKt__MapsJVMKt.toSingletonMap(MapsJVM.kt:139)
       at kotlin.collections.MapsKt__MapsKt.toMap(Maps.kt:626)
       at io.github.jan.supabase.realtime.RealtimeImpl.getSubscriptions(RealtimeImpl.java:44)
       at io.github.jan.supabase.realtime.RealtimeImpl$updateJwt$1.invokeSuspend(RealtimeImpl.kt:172)
       at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
       at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:101)
       at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt)
       at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:832)
       at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:720)
       at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:707)

Related Info: App was in foreground when this was reported.

Steps To Reproduce (optional)

No response

Relevant log output (optional)

No response

jan-tennert commented 2 hours ago

Might be related to this, but we can remove this toMap() call anyways since it's not needed.