-
Notifications
You must be signed in to change notification settings - Fork 166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Read more replies does not work, and pressing it too much will cause a crash #1183
Comments
I coulda swore the tree-building code should work correctly for missing comments, by just not displaying that. But yes I think adding either a blank template for the missing comment, saying something like "couldn't find comment" works best. |
The problem is that there needs to be a node with that id, else the insertion of the comment after the missing comment goes haywire. Presumably it appends somewhere at the end. (thus when scrolling fardown enough it will crash as it loads twice teh same comment) |
I'm not exactly sure why that key is getting re-used. Maybe using the entire path for the key would fix it? |
Because it is inserting twice the same comment because the read more replies button doesn't disappear |
So then we need to hide that button if its been clicked once. Could be done with remember state for that comment. |
If we properly insert the comment, (by adding the template missing comment) it will remove the read more replies. Like it does for other comment trees. We don't need any special logic for this. The crash is just unintended behaviour of bad handling of comment insertion. |
Jerboa Version
0.0.44
Android Version + Phone
N/A
Describe The Bug
Press read more replies nothing happens, press it again nothing happens, start scrolling, crash
stack trace
FATAL EXCEPTION: main Process: com.jerboa, PID: 26802 java.lang.IllegalArgumentException: Key "1996313" was already used. If you are using LazyColumn/Row please make sure you provide a unique key for each item. at androidx.compose.ui.layout.LayoutNodeSubcompositionsState$Scope.subcompose(Unknown Source:182) at androidx.compose.foundation.lazy.layout.LazyLayoutMeasureScopeImpl.measure-0kLqBqw(Unknown Source:33) at androidx.compose.foundation.lazy.LazyListKt$rememberLazyListMeasurePolicy$1$1$measuredItemProvider$1.getAndMeasure(Unknown Source:18) at androidx.compose.foundation.lazy.LazyListKt$rememberLazyListMeasurePolicy$1$1.invoke(Unknown Source:617) at androidx.navigation.compose.NavHostKt$NavHost$14$1.invoke(SourceFile:16) at androidx.compose.ui.layout.LayoutNodeSubcompositionsState$createMeasurePolicy$1.measure-3p2s80s(Unknown Source:91) at androidx.compose.ui.node.InnerNodeCoordinator.measure-BRTryo0(Unknown Source:45) at androidx.compose.ui.graphics.SimpleGraphicsLayerModifier.measure-3p2s80s(Unknown Source:5) at androidx.compose.ui.node.LayoutModifierNodeCoordinator.measure-BRTryo0(Unknown Source:10) at androidx.compose.foundation.layout.PaddingNode.measure-3p2s80s(Unknown Source:37) at androidx.compose.ui.node.LayoutModifierNodeCoordinator.measure-BRTryo0(Unknown Source:10) at okhttp3.internal.http2.Http2Connection$1.invoke(SourceFile:17) at okhttp3.internal.http2.Http2Connection$1.invoke(SourceFile:13) at androidx.compose.ui.Alignment$Companion.observe(Unknown Source:63) at androidx.compose.runtime.snapshots.SnapshotStateObserver$ObservedScopeMap.observe(Unknown Source:66) at androidx.compose.runtime.snapshots.SnapshotStateObserver.observeReads(Unknown Source:75) at androidx.compose.ui.node.OwnerSnapshotObserver.observeReads$ui_release(Unknown Source:12) at androidx.compose.ui.node.LayoutNodeLayoutDelegate$MeasurePassDelegate.remeasure-BRTryo0(Unknown Source:109) at androidx.compose.ui.node.MeasureAndLayoutDelegate.doRemeasure-sdFAvZA(Unknown Source:17) at androidx.compose.ui.node.MeasureAndLayoutDelegate.measureAndLayout-0kLqBqw(Unknown Source:60) at androidx.compose.ui.platform.AndroidComposeView.measureAndLayout-0kLqBqw(Unknown Source:12) at androidx.compose.ui.node.LayoutNode.forceRemeasure(Unknown Source:40) at androidx.compose.foundation.MagnifierKt$magnifier$4$3.invoke(SourceFile:27) at androidx.compose.foundation.MagnifierKt$magnifier$4$3.invoke(SourceFile:105) at androidx.compose.foundation.gestures.DefaultScrollableState$scrollScope$1.scrollBy(Unknown Source:16) at androidx.compose.runtime.RecomposeScopeImpl$end$1$2.invoke(Unknown Source:357) at androidx.compose.foundation.AndroidEdgeEffectOverscrollEffect.applyToScroll-Rhakbz0(Unknown Source:327) at androidx.compose.foundation.gestures.ScrollingLogic.dispatchScroll-3eAAhYA(Unknown Source:49) at androidx.compose.ui.ZIndexNode$measure$1.invoke(SourceFile:144) at androidx.compose.foundation.gestures.ScrollingLogic$doFlingAnimation$2$scope$1.scrollBy(Unknown Source:13) at com.jerboa.UtilsKt$border$1.invoke(SourceFile:111) at com.jerboa.UtilsKt$border$1.invoke(SourceFile:47) at kotlin.TuplesKt.doAnimationFrameWithScale(Unknown Source:64) at androidx.compose.animation.core.SuspendAnimationKt$animate$9.invoke(Unknown Source:35) at androidx.compose.foundation.layout.OffsetKt$offset$2.invoke(SourceFile:37) at androidx.compose.runtime.BroadcastFrameClock.sendFrame(Unknown Source:33) at androidx.compose.runtime.Recomposer$runRecomposeAndApplyChanges$2$1.invoke(Unknown Source:33) at androidx.compose.ui.platform.AndroidUiFrameClock$withFrameNanos$2$callback$1.doFrame(Unknown Source:6) at androidx.compose.ui.platform.AndroidUiDispatcher$dispatchCallback$1.doFrame(Unknown Source:47) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1074) at android.view.Choreographer.doCallbacks(Choreographer.java:897) at android.view.Choreographer.doFrame(Choreographer.java:822) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1061) at android.os.Handler.handleCallback(Handler.java:938) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:236) at android.app.ActivityThread.main(ActivityThread.java:8061) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:656) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:967) Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [androidx.compose.ui.platform.MotionDurationScaleImpl@fa11508, androidx.compose.runtime.BroadcastFrameClock@82e94a1, StandaloneCoroutine{Cancelling}@2a486c6, AndroidUiDispatcher@441e687]json comments response
issue_comments_reponse.zip
https://programming.dev/api/v3/comment/list?max_depth=6&parent_id=1992854&type_=All&auth=REDACTED
json comments reply reponse
I dug into this, the read more replies correctly gets the right response
but the path is for the parent comment
0.1988963.1992854
and the child comment0.1988963.1992854.1996159.1996313
There is a comment missing there and Jerboa does not handle that properly
Neither does Lemmy UI, tried to see what they did
To Reproduce
go to this post https://programming.dev/post/1758694
find the read more replies and press it
or alternative go directly to this comment
https://programming.dev/comment/1988963
In the case of a crash or when relevant include the logs
stack trace
FATAL EXCEPTION: main Process: com.jerboa, PID: 26802 java.lang.IllegalArgumentException: Key "1996313" was already used. If you are using LazyColumn/Row please make sure you provide a unique key for each item. at androidx.compose.ui.layout.LayoutNodeSubcompositionsState$Scope.subcompose(Unknown Source:182) at androidx.compose.foundation.lazy.layout.LazyLayoutMeasureScopeImpl.measure-0kLqBqw(Unknown Source:33) at androidx.compose.foundation.lazy.LazyListKt$rememberLazyListMeasurePolicy$1$1$measuredItemProvider$1.getAndMeasure(Unknown Source:18) at androidx.compose.foundation.lazy.LazyListKt$rememberLazyListMeasurePolicy$1$1.invoke(Unknown Source:617) at androidx.navigation.compose.NavHostKt$NavHost$14$1.invoke(SourceFile:16) at androidx.compose.ui.layout.LayoutNodeSubcompositionsState$createMeasurePolicy$1.measure-3p2s80s(Unknown Source:91) at androidx.compose.ui.node.InnerNodeCoordinator.measure-BRTryo0(Unknown Source:45) at androidx.compose.ui.graphics.SimpleGraphicsLayerModifier.measure-3p2s80s(Unknown Source:5) at androidx.compose.ui.node.LayoutModifierNodeCoordinator.measure-BRTryo0(Unknown Source:10) at androidx.compose.foundation.layout.PaddingNode.measure-3p2s80s(Unknown Source:37) at androidx.compose.ui.node.LayoutModifierNodeCoordinator.measure-BRTryo0(Unknown Source:10) at okhttp3.internal.http2.Http2Connection$1.invoke(SourceFile:17) at okhttp3.internal.http2.Http2Connection$1.invoke(SourceFile:13) at androidx.compose.ui.Alignment$Companion.observe(Unknown Source:63) at androidx.compose.runtime.snapshots.SnapshotStateObserver$ObservedScopeMap.observe(Unknown Source:66) at androidx.compose.runtime.snapshots.SnapshotStateObserver.observeReads(Unknown Source:75) at androidx.compose.ui.node.OwnerSnapshotObserver.observeReads$ui_release(Unknown Source:12) at androidx.compose.ui.node.LayoutNodeLayoutDelegate$MeasurePassDelegate.remeasure-BRTryo0(Unknown Source:109) at androidx.compose.ui.node.MeasureAndLayoutDelegate.doRemeasure-sdFAvZA(Unknown Source:17) at androidx.compose.ui.node.MeasureAndLayoutDelegate.measureAndLayout-0kLqBqw(Unknown Source:60) at androidx.compose.ui.platform.AndroidComposeView.measureAndLayout-0kLqBqw(Unknown Source:12) at androidx.compose.ui.node.LayoutNode.forceRemeasure(Unknown Source:40) at androidx.compose.foundation.MagnifierKt$magnifier$4$3.invoke(SourceFile:27) at androidx.compose.foundation.MagnifierKt$magnifier$4$3.invoke(SourceFile:105) at androidx.compose.foundation.gestures.DefaultScrollableState$scrollScope$1.scrollBy(Unknown Source:16) at androidx.compose.runtime.RecomposeScopeImpl$end$1$2.invoke(Unknown Source:357) at androidx.compose.foundation.AndroidEdgeEffectOverscrollEffect.applyToScroll-Rhakbz0(Unknown Source:327) at androidx.compose.foundation.gestures.ScrollingLogic.dispatchScroll-3eAAhYA(Unknown Source:49) at androidx.compose.ui.ZIndexNode$measure$1.invoke(SourceFile:144) at androidx.compose.foundation.gestures.ScrollingLogic$doFlingAnimation$2$scope$1.scrollBy(Unknown Source:13) at com.jerboa.UtilsKt$border$1.invoke(SourceFile:111) at com.jerboa.UtilsKt$border$1.invoke(SourceFile:47) at kotlin.TuplesKt.doAnimationFrameWithScale(Unknown Source:64) at androidx.compose.animation.core.SuspendAnimationKt$animate$9.invoke(Unknown Source:35) at androidx.compose.foundation.layout.OffsetKt$offset$2.invoke(SourceFile:37) at androidx.compose.runtime.BroadcastFrameClock.sendFrame(Unknown Source:33) at androidx.compose.runtime.Recomposer$runRecomposeAndApplyChanges$2$1.invoke(Unknown Source:33) at androidx.compose.ui.platform.AndroidUiFrameClock$withFrameNanos$2$callback$1.doFrame(Unknown Source:6) at androidx.compose.ui.platform.AndroidUiDispatcher$dispatchCallback$1.doFrame(Unknown Source:47) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1074) at android.view.Choreographer.doCallbacks(Choreographer.java:897) at android.view.Choreographer.doFrame(Choreographer.java:822) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1061) at android.os.Handler.handleCallback(Handler.java:938) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:236) at android.app.ActivityThread.main(ActivityThread.java:8061) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:656) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:967) Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [androidx.compose.ui.platform.MotionDurationScaleImpl@fa11508, androidx.compose.runtime.BroadcastFrameClock@82e94a1, StandaloneCoroutine{Cancelling}@2a486c6, AndroidUiDispatcher@441e687]The text was updated successfully, but these errors were encountered: