-
Notifications
You must be signed in to change notification settings - Fork 158
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
Crashfix: test for empty string in mentions #1171
base: main
Are you sure you want to change the base?
Crashfix: test for empty string in mentions #1171
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, though the root issue I suspect, is the client producing this event. It will probably need to be reported to them.
Yes.. I need to check nostr docs whether empty mentions like that are valid.. Or maybe just not defined. In any case amethyst should expect malformed messages and not crash. Display a toast to user.. Or just ignore silently? |
@davotoula you seem not to be the only one to have noticed(based on the replies to that note), and from opening it on many clients, most silently ignore it, and render it as is ( |
IMHO we should silently ignore it, and inform the devs of the source client for this note. |
|
That's with the debug build from pull request |
This is actually with the latest release build. |
@KotlinGeekDev can you please double check? I really don't see how it could work with release build. Note id: nostr:nevent1qqszh69u659yvc52ppfrcjmrssrwqnga02m4eru7med24atguj77pqgpzamhxue69uhhyetvv9ujumn0wd68ytnzv9hxgtczyqsfsmac8em4m9k33r99e803pnndvylqadl9w69q7zcjkd7d4ssmxqcyqqqqqqgx0u6l0 |
Got it. |
|
Which reply from above do you think shows it works with latest amethyst release? |
By the way, viewing works. It crashes if you click the create a comment button. |
Observing a crash when trying to comment on a specific note. Root cause looks a missing hex in the mention tag of the post:
{ "id": "2be8bcd50a46628a08523c4b638406e04d1d7ab75c8f9ede5aaaf568e4bde081", "pubkey": "20986fb83e775d96d188ca5c9df10ce6d613e0eb7e5768a0f0b12b37cdac21b3", "created_at": 1730957039, "kind": 1, "tags": [ [ "p", "", "", "mention" ] ],
Event ID:
nevent1qqszh69u659yvc52ppfrcjmrssrwqnga02m4eru7med24atguj77pqgpzamhxue69uhhyetvv9ujumn0wd68ytnzv9hxgtczyqsfsmac8em4m9k33r99e803pnndvylqadl9w69q7zcjkd7d4ssmxqcyqqqqqqgx0u6l0
The
isValidHex
function specifically fails empty hexes so I filter out the empty hex mention in the callingNewPostViewModel
class.