Skip to content
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

Crash while typing string in search [BUG] #1258

Open
alltheseas opened this issue Jan 21, 2025 · 23 comments
Open

Crash while typing string in search [BUG] #1258

alltheseas opened this issue Jan 21, 2025 · 23 comments
Assignees
Labels
bug Something isn't working merged Merged to master and ready to be realeased

Comments

@alltheseas
Copy link
Contributor

alltheseas commented Jan 21, 2025

Describe the bug
Search crash occurs before I can type in a full query

To Reproduce
Steps to reproduce the behavior:

  1. Open amethyst
  2. Top right search icon
  3. Start typing query (e.g. Sebastix)
  4. Observe crash

Expected behavior
Do not crash while I am typing search term.

Video and Screenshots

Image

**Device (please complete the following information):
DC-01

  • Android Version 13
    20241220.1638.user
  • App Version
    0.94.3
  • Amber Version (if using it to sign): n/a

Bounty (in Bitcoin sats) offered for a solution
The size of the bounty is proportional to how much this matters to you. If no bounty is offered,
not even a small one, this bug will not be worked on because it doesn't matter to you. We prioritize
bug fixing to issues that have bounties, even small ones.

@alltheseas alltheseas changed the title [BUG] Crash while typing string in search [BUG] Jan 21, 2025
@alltheseas
Copy link
Contributor Author

I can search for "Vitor" successfully

@greenart7c3
Copy link
Contributor

I could not reproduce this. Are you in the latest version 0.94.3? Can you provide a crash report?

@alltheseas
Copy link
Contributor Author

Are you in the latest version 0.94.3

yes.

Can you provide a crash report?

How do I do this?

@greenart7c3
Copy link
Contributor

You you are using graphene os theres a view logs button inside the app info screen.
If you are not using grapheneos you need to enable developer options and inside the developer options menu theres a bug report button.

@alltheseas
Copy link
Contributor Author

android 13 . I'll check shortly

@alltheseas
Copy link
Contributor Author

I think @ksedgwic reported identical behavior. Which device, OS, and amethyst version are you on @ksedgwic?

@alltheseas
Copy link
Contributor Author

Of course now that I try to recreate the bug on a new day, I cannot recreate.

@ksedgwic
Copy link

@alltheseas:
Pixel Tablet w/
android version: Android 15
amethyst version: v0.94.3-PLAY
search string: sebastix (I only get to "seb" and it crashes, something evil found?)

Other seaches seem ok, "sebastix" is evil ...

@davotoula
Copy link
Collaborator

I can confirm the crash on searching "seb".

Google play, pixel 7, 94.3

Having a look now.

@davotoula davotoula self-assigned this Jan 23, 2025
@davotoula davotoula added the bug Something isn't working label Jan 23, 2025
@davotoula
Copy link
Collaborator

Reproducible only after a "cold start" of amethyst (after using force close) and quickly navigating to search bar.

Other search queries than "seb" do not reproduce the issue. Must be something in the search results of "seb"?

06:00:51.904 E FATAL EXCEPTION: main Process: com.vitorpamplona.amethyst, PID: 15380 java.lang.IllegalArgumentException: Can't represent a width of 5196264 and height of 0 in Constraints at androidx.compose.ui.unit.ConstraintsKt.invalidConstraint(Unknown Source:29) at androidx.compose.ui.unit.ConstraintsKt.createConstraints(Unknown Source:26) at androidx.compose.ui.unit.Constraints$Companion.fixedWidth-OenEA2s(Unknown Source:34) at androidx.compose.foundation.layout.IntrinsicWidthNode.calculateContentConstraints-l58MMJ0(Unknown Source:28) at androidx.compose.foundation.layout.IntrinsicSizeModifier.measure-3p2s80s(Unknown Source:0) at androidx.compose.ui.node.LayoutModifierNodeCoordinator.measure-BRTryo0(Unknown Source:37) at androidx.compose.ui.node.LayoutNodeLayoutDelegate$performMeasureBlock$1.invoke(SourceFile:2) at androidx.compose.ui.node.LayoutNodeLayoutDelegate$performMeasureBlock$1.invoke(SourceFile:1) at androidx.compose.runtime.snapshots.Snapshot$Companion.observe(Unknown Source:68) at androidx.compose.runtime.snapshots.SnapshotStateObserver$ObservedScopeMap.observe(Unknown Source:45) at androidx.compose.runtime.snapshots.SnapshotStateObserver.observeReads(Unknown Source:93) at androidx.compose.ui.node.OwnerSnapshotObserver.observeReads$ui_release(Unknown Source:2) at androidx.compose.ui.node.OwnerSnapshotObserver.observeMeasureSnapshotReads$ui_release(Unknown Source:16) at androidx.compose.ui.node.LayoutNodeLayoutDelegate.performMeasure-BRTryo0(Unknown Source:39) at androidx.compose.ui.node.LayoutNodeLayoutDelegate.access$performMeasure-BRTryo0(Unknown Source:0) at androidx.compose.ui.node.LayoutNodeLayoutDelegate$MeasurePassDelegate.remeasure-BRTryo0(Unknown Source:145) at androidx.compose.ui.node.LayoutNodeLayoutDelegate$MeasurePassDelegate.measure-BRTryo0(Unknown Source:59) at androidx.compose.foundation.layout.BoxMeasurePolicy.measure-3p2s80s(Unknown Source:72) at androidx.compose.foundation.layout.BoxWithConstraintsKt$BoxWithConstraints$1$1.invoke-0kLqBqw(Unknown Source:29) at androidx.compose.foundation.layout.BoxWithConstraintsKt$BoxWithConstraints$1$1.invoke(Unknown Source:8) at androidx.compose.ui.layout.LayoutNodeSubcompositionsState$createMeasurePolicy$1.measure-3p2s80s(Unknown Source:112) at androidx.compose.ui.node.InnerNodeCoordinator.measure-BRTryo0(Unknown Source:72) at androidx.compose.foundation.layout.FillNode.measure-3p2s80s(Unknown Source:98) at androidx.compose.ui.node.LayoutModifierNodeCoordinator.measure-BRTryo0(Unknown Source:37) at androidx.compose.ui.node.LayoutNodeLayoutDelegate$performMeasureBlock$1.invoke(SourceFile:2) at androidx.compose.ui.node.LayoutNodeLayoutDelegate$performMeasureBlock$1.invoke(SourceFile:1) at androidx.compose.runtime.snapshots.Snapshot$Companion.observe(Unknown Source:68) at androidx.compose.runtime.snapshots.SnapshotStateObserver$ObservedScopeMap.observe(Unknown Source:45) at androidx.compose.runtime.snapshots.SnapshotStateObserver.observeReads(Unknown Source:93) at androidx.compose.ui.node.OwnerSnapshotObserver.observeReads$ui_release(Unknown Source:2) at androidx.compose.ui.node.OwnerSnapshotObserver.observeMeasureSnapshotReads$ui_release(Unknown Source:16) at androidx.compose.ui.node.LayoutNodeLayoutDelegate.performMeasure-BRTryo0(Unknown Source:39) at androidx.compose.ui.node.LayoutNodeLayoutDelegate.access$performMeasure-BRTryo0(Unknown Source:0) at androidx.compose.ui.node.LayoutNodeLayoutDelegate$MeasurePassDelegate.remeasure-BRTryo0(Unknown Source:145) at androidx.compose.ui.node.LayoutNodeLayoutDelegate$MeasurePassDelegate.measure-BRTryo0(Unknown Source:59) at androidx.compose.foundation.layout.BoxMeasurePolicy.measure-3p2s80s(Unknown Source:72) at androidx.compose.ui.node.InnerNodeCoordinator.measure-BRTryo0(Unknown Source:72) at androidx.compose.ui.graphics.BlockGraphicsLayerModifier.measure-3p2s80s(Unknown Source:0) at androidx.compose.ui.node.LayoutModifierNodeCoordinator.measure-BRTryo0(Unknown Source:37) 06:00:51.904 E at androidx.compose.ui.node.LayoutNodeLayoutDelegate$performMeasureBlock$1.invoke(SourceFile:2) (Ask Gemini) at androidx.compose.ui.node.LayoutNodeLayoutDelegate$performMeasureBlock$1.invoke(SourceFile:1) at androidx.compose.runtime.snapshots.Snapshot$Companion.observe(Unknown Source:68) at androidx.compose.runtime.snapshots.SnapshotStateObserver$ObservedScopeMap.observe(Unknown Source:45) at androidx.compose.runtime.snapshots.SnapshotStateObserver.observeReads(Unknown Source:93) at androidx.compose.ui.node.OwnerSnapshotObserver.observeReads$ui_release(Unknown Source:2) at androidx.compose.ui.node.OwnerSnapshotObserver.observeMeasureSnapshotReads$ui_release(Unknown Source:16) at androidx.compose.ui.node.LayoutNodeLayoutDelegate.performMeasure-BRTryo0(Unknown Source:39) at androidx.compose.ui.node.LayoutNodeLayoutDelegate.access$performMeasure-BRTryo0(Unknown Source:0) at androidx.compose.ui.node.LayoutNodeLayoutDelegate$MeasurePassDelegate.remeasure-BRTryo0(Unknown Source:145) at androidx.compose.ui.node.LayoutNodeLayoutDelegate$MeasurePassDelegate.measure-BRTryo0(Unknown Source:59) at androidx.compose.foundation.layout.BoxMeasurePolicy.measure-3p2s80s(Unknown Source:72) at androidx.compose.ui.node.InnerNodeCoordinator.measure-BRTryo0(Unknown Source:72) at androidx.compose.ui.node.LayoutNodeLayoutDelegate$performMeasureBlock$1.invoke(SourceFile:2) at androidx.compose.ui.node.LayoutNodeLayoutDelegate$performMeasureBlock$1.invoke(SourceFile:1) at androidx.compose.runtime.snapshots.Snapshot$Companion.observe(Unknown Source:68) at androidx.compose.runtime.snapshots.SnapshotStateObserver$ObservedScopeMap.observe(Unknown Source:45) at androidx.compose.runtime.snapshots.SnapshotStateObserver.observeReads(Unknown Source:93) at androidx.compose.ui.node.OwnerSnapshotObserver.observeReads$ui_release(Unknown Source:2) at androidx.compose.ui.node.OwnerSnapshotObserver.observeMeasureSnapshotReads$ui_release(Unknown Source:16) at androidx.compose.ui.node.LayoutNodeLayoutDelegate.performMeasure-BRTryo0(Unknown Source:39) at androidx.compose.ui.node.LayoutNodeLayoutDelegate.access$performMeasure-BRTryo0(Unknown Source:0) at androidx.compose.ui.node.LayoutNodeLayoutDelegate$MeasurePassDelegate.remeasure-BRTryo0(Unknown Source:145) at androidx.compose.ui.node.LayoutNodeLayoutDelegate$MeasurePassDelegate.measure-BRTryo0(Unknown Source:59) at androidx.compose.foundation.lazy.layout.LazyLayoutMeasureScopeImpl.measure-0kLqBqw(Unknown Source:57) at androidx.compose.foundation.lazy.LazyListMeasuredItemProvider.getAndMeasure-0kLqBqw(Unknown Source:14) at androidx.compose.foundation.lazy.LazyListMeasuredItemProvider.getAndMeasure-0kLqBqw$default(Unknown Source:8) at androidx.compose.foundation.lazy.LazyListMeasureKt.measureLazyList-x0Ok8Vo(Unknown Source:331) at androidx.compose.foundation.lazy.LazyListKt$rememberLazyListMeasurePolicy$1$1.invoke-0kLqBqw(Unknown Source:516) at androidx.compose.foundation.lazy.LazyListKt$rememberLazyListMeasurePolicy$1$1.invoke(Unknown Source:8) at androidx.compose.foundation.lazy.layout.LazyLayoutKt$LazyLayout$3$2$1.invoke-0kLqBqw(Unknown Source:13) at androidx.compose.foundation.lazy.layout.LazyLayoutKt$LazyLayout$3$2$1.invoke(Unknown Source:8) at androidx.compose.ui.layout.LayoutNodeSubcompositionsState$createMeasurePolicy$1.measure-3p2s80s(Unknown Source:112) at androidx.compose.ui.node.InnerNodeCoordinator.measure-BRTryo0(Unknown Source:72) at androidx.compose.ui.graphics.SimpleGraphicsLayerModifier.measure-3p2s80s(Unknown Source:0) at androidx.compose.ui.node.LayoutModifierNodeCoordinator.measure-BRTryo0(Unknown Source:37) at androidx.compose.foundation.layout.FillNode.measure-3p2s80s(Unknown Source:98) at androidx.compose.ui.node.LayoutModifierNodeCoordinator.measure-BRTryo0(Unknown Source:37) at androidx.compose.ui.node.LayoutNodeLayoutDelegate$performMeasureBlock$1.invoke(SourceFile:2) at androidx.compose.ui.node.LayoutNodeLayoutDelegate$performMeasureBlock$1.invoke(SourceFile:1) 06:00:51.904 E at androidx.compose.runtime.snapshots.Snapshot$Companion.observe(Unknown Source:129) (Ask Gemini) at androidx.compose.runtime.snapshots.SnapshotStateObserver$ObservedScopeMap.observe(Unknown Source:45) at androidx.compose.runtime.snapshots.SnapshotStateObserver.observeReads(Unknown Source:93) at androidx.compose.ui.node.OwnerSnapshotObserver.observeReads$ui_release(Unknown Source:2) at androidx.compose.ui.node.OwnerSnapshotObserver.observeMeasureSnapshotReads$ui_release(Unknown Source:16) at androidx.compose.ui.node.LayoutNodeLayoutDelegate.performMeasure-BRTryo0(Unknown Source:39) at androidx.compose.ui.node.LayoutNodeLayoutDelegate.access$performMeasure-BRTryo0(Unknown Source:0) at androidx.compose.ui.node.LayoutNodeLayoutDelegate$MeasurePassDelegate.remeasure-BRTryo0(Unknown Source:145) at androidx.compose.ui.node.LayoutNode.remeasure-_Sx5XlM$ui_release(Unknown Source:19) at androidx.compose.ui.node.LayoutNode.remeasure-_Sx5XlM$ui_release$default(Unknown Source:10) at androidx.compose.ui.node.MeasureAndLayoutDelegate.doRemeasure-sdFAvZA(Unknown Source:9) at androidx.compose.ui.node.MeasureAndLayoutDelegate.remeasureAndRelayoutIfNeeded(Unknown Source:105) at androidx.compose.ui.node.MeasureAndLayoutDelegate.remeasureAndRelayoutIfNeeded$default(Unknown Source:11) at androidx.compose.ui.node.MeasureAndLayoutDelegate.measureAndLayout(Unknown Source:95) at androidx.compose.ui.platform.AndroidComposeView.measureAndLayout(Unknown Source:32) at androidx.compose.ui.node.Owner.measureAndLayout$default(Unknown Source:7) at androidx.compose.ui.platform.AndroidComposeView.dispatchDraw(Unknown Source:16) at android.view.View.draw(View.java:24880) at android.view.View.updateDisplayListIfDirty(View.java:23727) at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4540) at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4513) at android.view.View.updateDisplayListIfDirty(View.java:23681) at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4540) at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4513) at android.view.View.updateDisplayListIfDirty(View.java:23681) at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4540) at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4513) at android.view.View.updateDisplayListIfDirty(View.java:23681) at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4540) at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4513) at android.view.View.updateDisplayListIfDirty(View.java:23681) at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4540) at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4513) at android.view.View.updateDisplayListIfDirty(View.java:23681) at android.view.ViewGroup.recreateChildDisplayList(ViewGroup.java:4540) at android.view.ViewGroup.dispatchGetDisplayList(ViewGroup.java:4513) at android.view.View.updateDisplayListIfDirty(View.java:23681) at android.view.ThreadedRenderer.updateViewTreeDisplayList(ThreadedRenderer.java:694) at android.view.ThreadedRenderer.updateRootDisplayList(ThreadedRenderer.java:700) at android.view.ThreadedRenderer.draw(ThreadedRenderer.java:798) at android.view.ViewRootImpl.draw(ViewRootImpl.java:5726) at android.view.ViewRootImpl.performDraw(ViewRootImpl.java:5378) at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:4377) at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:2977) at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:10429) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1415) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1424) at android.view.Choreographer.doCallbacks(Choreographer.java:1024) at android.view.Choreographer.doFrame(Choreographer.java:953) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1398) at android.os.Handler.handleCallback(Handler.java:991) 06:00:51.904 E at android.os.Handler.dispatchMessage(Handler.java:102) (Ask Gemini) at android.os.Looper.loopOnce(Looper.java:232) at android.os.Looper.loop(Looper.java:317) at android.app.ActivityThread.main(ActivityThread.java:8787) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:591) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:871)

@davotoula
Copy link
Collaborator

Unable to reproduce on emulator but pretty reproducible with on-device debugging.

@greenart7c3
Copy link
Contributor

Must be some image with wrong dimensions in the event

@davotoula
Copy link
Collaborator

Finally found the note that is causing the crash when it appears in search results:

nevent1qqszq5cm60nzccwtnww28jfnh53cg0ld8v8m53xwtyuvlzgnwdqxf5cpzamhxue69uhhyetvv9ujuurjd9kkzmpwdejhgtczypcz7s0nvjc98pmrhpy39r4wh0sywmqynes8s3386v57p4ehnvvl6qcyqqqqgfcw979qw

Contains massive data:image/jpeg;base64. I guess search results trying to show the text content rather than the image?

@KotlinGeekDev
Copy link
Contributor

KotlinGeekDev commented Jan 27, 2025

Finally found the note that is causing the crash when it appears in search results:

nevent1qqszq5cm60nzccwtnww28jfnh53cg0ld8v8m53xwtyuvlzgnwdqxf5cpzamhxue69uhhyetvv9ujuurjd9kkzmpwdejhgtczypcz7s0nvjc98pmrhpy39r4wh0sywmqynes8s3386v57p4ehnvvl6qcyqqqqgfcw979qw

Contains massive data:image/jpeg;base64. I guess search results trying to show the text content rather than the image?

From looking at the base64 image, it seems Amethyst crashes when trying to render the base64 image(it is really really large). It is not just limited to Amethyst. Even Njump can't render it.

@davotoula
Copy link
Collaborator

I haven't had time to finish this but it looks like the NoteView that is in use cannot handle base64 images but RichTextViewer can? I'll get back to it shortly

@KotlinGeekDev
Copy link
Contributor

I haven't had time to finish this but it looks like the NoteView that is in use cannot handle base64 images but RichTextViewer can? I'll get back to it shortly

Got it.

@alltheseas
Copy link
Contributor Author

Same behavior when I attempt to search for "Dawn"

@davotoula
Copy link
Collaborator

Same behavior when I attempt to search for "Dawn"

There is a fix. It is waiting for review, merge and release.

@alltheseas
Copy link
Contributor Author

Same behavior when I attempt to search for "Dawn"

There is a fix. It is waiting for review, merge and release.

Understood. Perhaps worth testing the proposed solution with another search term that leads to a crash.

@davotoula
Copy link
Collaborator

Yes, good idea but I cannot reproduce the crash using "dawn". It can depend on your relays and the users you follow.

@alltheseas
Copy link
Contributor Author

Noted. I will try to reproduce when the fix is merged.

@davotoula davotoula added the merged Merged to master and ready to be realeased label Jan 30, 2025
@davotoula
Copy link
Collaborator

@alltheseas

The debug build is avilable here:
Artifact download URL: https://github.com/vitorpamplona/amethyst/actions/runs/13008982078/artifacts/2496700972

Feel free to test the issue. Please login with your nsec to recreate the search behaviour.

@alltheseas
Copy link
Contributor Author

Using above debug APK searching for "sebastix", "dawn" I did not crash. Thanks for the fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working merged Merged to master and ready to be realeased
Projects
None yet
Development

No branches or pull requests

5 participants