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

bug: account search error 404 for existing account #1348

Open
elboletaire opened this issue Jul 4, 2024 · 6 comments · May be fixed by #1351
Open

bug: account search error 404 for existing account #1348

elboletaire opened this issue Jul 4, 2024 · 6 comments · May be fixed by #1351
Labels
bug Something isn't working

Comments

@elboletaire
Copy link
Member

Describe the bug
An existing account does not appear on searches.

To Reproduce

Accessing the account returns data, since it exists

curl -s 'https://api-dev.vocdoni.net/v2/accounts/38d2BC91B89928f78cBaB3e4b1949e28787eC7a3' | jq

Doing a search for that account returns 404:

curl 'https://api-dev.vocdoni.net/v2/chain/organizations/filter/page/0' --compressed -X POST -H 'Content-Type: application/json' --data-raw '{"organizationId":"38d2BC91B89928f78cBaB3e4b1949e28787eC7a3"}' | jq
@elboletaire elboletaire added the bug Something isn't working label Jul 4, 2024
@mvdan
Copy link
Contributor

mvdan commented Jul 4, 2024

Any particular reason why you are mixing uppercase and lowercase letters? That might be tripping up the search. We could normalize the input for this.

@elboletaire
Copy link
Member Author

Probably due to copying it from metamask, which gives it that way.

@jordipainan
Copy link
Member

Any particular reason why you are mixing uppercase and lowercase letters? That might be tripping up the search. We could normalize the input for this.

https://eips.ethereum.org/EIPS/eip-55

@p4u
Copy link
Member

p4u commented Jul 4, 2024

Yes, we should normalize it.

@p4u
Copy link
Member

p4u commented Jul 4, 2024

can yu take it @mvdan ?

@mvdan
Copy link
Contributor

mvdan commented Jul 4, 2024

Ah I didn't know this, SGTM. Yes, I'll do a fix.

mvdan added a commit to mvdan/go-dvote that referenced this issue Jul 6, 2024
Since the SQL query uses INSTR with LOWER and HEX, the input hex string
will never match if it contains any uppercase characters.
Normalize the input string as lowercase to avoid that issue.

In particular, uppercase letters can happen due to
https://eips.ethereum.org/EIPS/eip-55.

Fixes vocdoni#1348.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants