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

NIP-33 Bug on querying identifier tag (postgresql) #142

Open
mstoecklein opened this issue Jul 18, 2023 · 2 comments
Open

NIP-33 Bug on querying identifier tag (postgresql) #142

mstoecklein opened this issue Jul 18, 2023 · 2 comments

Comments

@mstoecklein
Copy link

mstoecklein commented Jul 18, 2023

I was querying a specific replaceable parametrized event that contains a #d tag with an identifier that contains an even amount of characters. This caused the hex code check to be completely ignored and assumed to be a hex code.

Here is the code that causes the error:

if (v.len() % 2 != 0) && !is_lower_hex(v) {

This seems to fix it:

if v.len() % 2 == 0 && is_lower_hex(v) {
    tag_query.push_bind(hex::decode(v).ok());
} else {
    tag_query.push_bind(v.as_bytes());
}

I don't know much about Rust, which is why I didn't do a PR.

@mstoecklein mstoecklein changed the title NIP-33 Bug on querying identifier tag NIP-33 Bug on querying identifier tag (postgresql) Jul 18, 2023
@v0l
Copy link
Contributor

v0l commented Nov 20, 2023

It should be fixed by #164

@mstoecklein
Copy link
Author

I will test it during the week. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants