strongbox-password-safe / Strongbox

A KeePass/Password Safe Client for iOS and OS X
https://strongboxsafe.com
GNU Affero General Public License v3.0
1.29k stars 100 forks source link

Sort from most specific match when the match is beyond the PSL suffix #754

Open tonyxu-io opened 5 months ago

tonyxu-io commented 5 months ago

Created a new issue to capture the issue we discussed:

In email correspondence we discovered there is a slight bug in sorting of URLs, they're not always sorted from most specific match as they should be when the match is beyond the PSL suffix. e.g.

  1. https://abc.linked.com
  2. https://grid.linked.com

when visiting https://some-sub-domain.grid.linkedin.com, URL 2 should be sorted as the best match. Currently this isn't the case. We'll work on fixing that. Thanks @tonyxu-io

Originally posted by @strongbox-mark in https://github.com/strongbox-password-safe/Strongbox/issues/743#issuecomment-1890443048

strongbox-mark commented 5 months ago

Hi @tonyxu-io - This should be fix for you know with 1.59.0 - feel free to reopen if that's not so.

tonyxu-io commented 5 months ago

Wow! That's amazing! Thanks a lot for fixing this so quickly!

tonyxu-io commented 4 months ago

Hi @strongbox-mark, it's very strange, the problem solved for some-sub-domain.grid.linkedin.com when I have password for grid.linkedin.com. But the same issue still exist for some-sub-domain.x.linkedin.com when I have x.linkedin.com password. This is hard to believe.

strongbox-mark commented 4 months ago

Hi @tonyxu-io - Sorry to hear that. Could you please provide the 2 urls that are sorting incorrectly and the url that you are visiting and we can take a look.

tonyxu-io commented 4 months ago
strongbox-mark commented 4 months ago

Hi @tonyxu-io - I'm afraid I can't reproduce this. Maybe I have your details wrong. Here is what I did:

I have 2 entries with the following URLs:

and I go to visit:

The results are correctly sorted as:

What have I done wrong? Could you please supply 2 entry URLs AND the URL you are visiting, AND the result you are seeing? I'm afraid it's not super clear above.

tonyxu-io commented 4 months ago

Actually I'm storing them in the custom URL field (because I have multiple URLs to match for this password): URL_GO: https://go.corp.linkedin.com/

When I directly use the primary URL field it's sorting fine.

strongbox-mark commented 4 months ago

So, that's a fairly important bit of information. Investigating bugs consumes our time and resources. There are other things we can work on, so it's important not to waste time. :)

So, if there's still an issue, what I'll need is:

Thanks.

tonyxu-io commented 4 months ago

Entry 1: www.linkedin.com (primary URL) Entry 2: grid.linkedin.com (primary URL), go.corp.linkedin.com (Secondary URL) URL Visiting: go.corp.linkedin.com Result: Entry 1 shown as first, Entry 2 shown as second Expected Result: Entry 2 shown as first, entry 1 shown as second (because the URL visiting has an exact match with secondary URL from entry 2)