4.1 RC - A User Should Not Be Able to Add Duplicate Custom URLs
Build from: https://bugzilla.mozilla.org/show_bug.cgi?id=1447461 - app-focus-webview-universal-release-signed-and-aligned.apk Pixel 2 - Android 8.1
Steps:
- Go to Settings -> URL Autocomplete -> Custom URL
- Enable Custom URL and tap on it
- add several custom URLs ( try same one different times)
- Tap 3 dots menu and choose remove
- Choose one of the duplicates
Expected:
- at step 3 you should not be able to add duples
Actual:
- at step 3 you are able to add dupes
Note:
- I have added the deletion steps because i got to this enhancement by mistake - I have added Mozilla.org and mozilla.org and thought they are displayed the same name but read different but when deleting one mozilla.org both are deleted.
- if we keep allowing dupes we should not delete all instance at once

@bbinto to decide where to put this.
@brampitoyo Do we want to show a toast if the user tries to add a domain that already exists? Or is it okay for it to just act like its been added since the domain is already in the list?
Is this issue solved or is still pending?
Hey @shikhart98, the issue is pending an answer from UX with the expected behavior. :) Once we get an answer you're more than welcome to pick it up
The expected behaviour is for the form to give a “URL already exists” error on submission.
If everything else looks good, this issue is now ready to pick up.
I'm working on it! almost done! will make a PR today.
On Tue, Apr 3, 2018, 4:38 AM Bram Pitoyo [email protected] wrote:
The expected behaviour is for the form to give a “URL already exists” error on submission.
[image: url-already-exists] https://user-images.githubusercontent.com/51007/38220568-fbb50964-372e-11e8-843c-cedae62d5339.png
If everything else looks good, this issue is now ready to pick up.
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/mozilla-mobile/focus-android/issues/2363#issuecomment-378076781, or mute the thread https://github.com/notifications/unsubscribe-auth/Ab8ucRfH-BO0gpgxztepblKUVGuPPhYTks5tkq9xgaJpZM4S1HJK .
Previously I have added a tost over there

@brampitoyo I tried implementing what you want, but did not find any function in UrlAutoCompleteFilter.kt to get the list of customDomains so that I can put condition and show error! I also wrote a function to return the customDomains in UrlAutoCompleteFilter.kt but something is going wrong as the list I get is always empty.
I think this is an engineering question for @boek or @pocmo! Pinging them here.
@brampitoyo I have solved the problem and this issue! just making a PR to this.
Can someone just review my PR on this issue.