bitwarden / android

Bitwarden mobile app for Android.
https://bitwarden.com
GNU General Public License v3.0
6.17k stars 786 forks source link

Regex matching not working #3554

Open Araxeus opened 1 month ago

Araxeus commented 1 month ago

Bitwarden Beta

Steps To Reproduce

I have tested 2 different regexes on different domains, both work on web, and with the old android version, but fail on beta build

  1. Create a regex URI matcher
  2. navigate to a matching page with a login form

Expected Result

autocomplete works

Actual Result

autocomplete doesnt work

Screenshots or Videos

No response

Additional Context

No response

Build Version

2024.7.1-beta (18876)

Environment Details

Issue Tracking Info

sammbw commented 1 month ago

Hi there,

I am unable to reproduce this issue, it has been escalated for further investigation. If you have more information that can help us, please add it below. If you are able to provide the regex you used, as well as an example URL, that would be very helpful!

Thanks!

Araxeus commented 1 month ago

Ok the exact regex that doesnt work for me is ^https:\/\/operate-pr-\d+\.onrender\.com\/login$ ill once again say it works on all apps but the android beta

here is the exact setup:

{
  Website: "https://operate.onrender.com/",
  URI: "^https:\/\/operate-pr-\d+\.onrender\.com\/login$"
}

if i go to https://operate-pr-12.onrender.com/login it doesnt match ONLY on the android beta

the regex match PR urls made by render - see https://docs.render.com/pull-request-previews / https://github.com/Araxeus/opl-whatsapp-server/pull/12#issuecomment-2231745315

(those -pr- .onrender websites go to sleep after 15min of unused, and it takes 2min to wakeup if it was asleep when you make a request or navigate to it)

Araxeus commented 1 month ago

On Chrome (desktop with extension):

image

On Android Beta:

Screenshot_2024-08-02-17-15-30-264_com.x8bit.bitwarden.beta.jpg

Araxeus commented 1 month ago

ok well I just realized whats causing this issue:

This is still a bug IMO because users would expect the android app and the browser extension to behave the same way

I've fixed the issue for my usecase by making the /login part at the end optional in the regex:

^https:\/\/operate-pr-\d+\.onrender\.com(?:\/login)?$

for the record both the chrome extension and the android app have default URI match set to "Base domain" but it shouldn't matter image


another weird thing is that the android app tries to match the domain name without / at the end, aka https://operate-pr-25.onrender.com (path doesnt matter because of bug above)

while if you go on your browser to https://operate-pr-25.onrender.com, the extension tries to match https://operate-pr-25.onrender.com/ (with a / at the end) which can also breaks regex logic

to account for that behavior I would have to add another \/? at the end of the regex, aka: ^https:\/\/operate-pr-\d+\.onrender\.com(?:\/login)?\/?$