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

Handle search maxlength on the backend as well #32

Closed
michallepicki opened this issue Jan 21, 2020 · 5 comments · May be fixed by #34
Closed

Handle search maxlength on the backend as well #32

michallepicki opened this issue Jan 21, 2020 · 5 comments · May be fixed by #34

Comments

@michallepicki
Copy link

Text input's maxlength attribute is supported on most browsers but on most Android browsers, the additional characters get removed after input focus is lost (see https://caniuse.com/#search=maxleng ). This leads to "funny" behavior when typing very long strings, but really this is just a too-easy way to put unnecessarily load onto the server.

@joladev
Copy link
Collaborator

joladev commented Jan 21, 2020

Very long strings are not a huge issue here, it just does a lookup in an ETS table. But what is "funny" behavior? If it's breaking the app in some way it would be really useful to know!

@michallepicki
Copy link
Author

michallepicki commented Jan 21, 2020

Just unresponsiveness after typing a long query:
Screen_Recording_20200121-181423_1

Clearing it doesn't immediately help as well, one has to refresh or wait a minute or two:

Screen_Recording_20200121-181423_2

This is not a big issue but I think can be easily addressed :)

@michallepicki
Copy link
Author

it just does a lookup in an ETS table

It also computes jaro distance to all package names, right? This is the "slowest" part if I had to guess

@joladev
Copy link
Collaborator

joladev commented Jan 21, 2020

@michallepicki yeah that could be it, I'll experiment a bit. I noticed it actually gets a little bit sluggish even at the 30th character on my laptop.

@ericmj
Copy link
Member

ericmj commented Jul 30, 2020

maxlength is removed on the frontend so it's no longer needed on the backend :).

@ericmj ericmj closed this as completed Jul 30, 2020
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

Successfully merging a pull request may close this issue.

3 participants