Realtime exception handler fix - #1857
Conversation
Greptile SummaryThe PR adds Android lifecycle callback dispatching and Flutter policy-violation error delivery, together with cross-runtime realtime error coverage.
Confidence Score: 3/5The PR is not yet safe to merge because Android lifecycle callbacks remain shared across Realtime instances, preserving both callback leakage and wrong-instance delivery. The reply states that the callback lists were moved to instance fields, but the current template still declares them inside the companion object; consequently, lifecycle events are dispatched across instances and disconnecting one instance clears callbacks registered by others. Files Needing Attention: templates/android/library/src/main/java/io/package/services/Realtime.kt.twig Important Files Changed
Reviews (4): Last reviewed commit: "fix(kotlin): share realtime lifecycle ca..." | Re-trigger Greptile |
…ear on disconnect
| private val onErrorCallbacks = CopyOnWriteArrayList<(Throwable?, Int?) -> Unit>() | ||
| private val onCloseCallbacks = CopyOnWriteArrayList<() -> Unit>() | ||
| private val onOpenCallbacks = CopyOnWriteArrayList<() -> Unit>() | ||
| } | ||
|
|
||
| fun onError(callback: (error: Throwable?, statusCode: Int?) -> Unit) { | ||
| onErrorCallbacks.add(callback) | ||
| } | ||
|
|
||
| fun onClose(callback: () -> Unit) { | ||
| onCloseCallbacks.add(callback) | ||
| } | ||
|
|
||
| fun onOpen(callback: () -> Unit) { | ||
| onOpenCallbacks.add(callback) | ||
| } |
There was a problem hiding this comment.
Why are these added now? Was it missed earlier?
There was a problem hiding this comment.
yes was a regression
What does this PR do?
(Provide a description of what this PR does.)
Test Plan
(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work.)
Related PRs and Issues
(If this PR is related to any other PR or resolves any issue or related to any issue link all related PR and issues here.)
Have you read the Contributing Guidelines on issues?
(Write your answer here.)