Skip to content

Not sorting correctly #15

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

Open
Gitoffthelawn opened this issue Apr 20, 2020 · 6 comments
Open

Not sorting correctly #15

Gitoffthelawn opened this issue Apr 20, 2020 · 6 comments

Comments

@Gitoffthelawn
Copy link

When sorting by URL, bookmarks are not being sorted correctly.

Also, is it ignoring the portion of the URL that consists of parameters (everything after a question mark), or is it using that data too?

@Gitoffthelawn
Copy link
Author

After performing more testing, it's not just URL sorting that has an issue. It's all sorting.

I think it may be limited to folders with a large number of bookmarks. I tested it on one of my "need to sort" bookmark folders, which unfortunately, currently has 1919 bookmarks. We'll need a few more worldwide shutdowns until I get through that tedious project.

What happens is that, after sorting, there are multiple sections of properly sorted bookmarks within a folder. The result takes on this form:

A
B
C
A
B
C

BTW, Firefox has native alphabetic bookmark sorting included, and it's very fast. Can you access it via an API? If so, does it have any parameters to specify other sort-by fields?

@Gitoffthelawn Gitoffthelawn changed the title URL Sorting not sorting correctly Not sorting correctly Apr 20, 2020
@heftig
Copy link
Owner

heftig commented Apr 20, 2020

Do you have separators between the sorted sections?

@Gitoffthelawn
Copy link
Author

Gitoffthelawn commented Apr 20, 2020

No separators.

The results make me think that there may be a recursive process that is iterating one too few times.

@heftig
Copy link
Owner

heftig commented Apr 20, 2020

Not quite; the code assumes that gaps in the indices of items mean separators are present. This was the case in Firefox before version 57, when separators became explicit items. So every continuous run of indices is sorted separately. Are there other special items between the sorted sections that don't show up in the API? The sort can't produce predictable results when we don't see all items.

@Gitoffthelawn
Copy link
Author

What type of other special items? There are no items visible within Firefox between the sections.

@Gitoffthelawn
Copy link
Author

Gitoffthelawn commented Apr 20, 2020

I don't know if it's relevant, but the first character of the bookmark title of the last item in the first section is a single quote. That title contains a total of 4 single quotes, and a comma after the quotes. This is the title:

'Clean Home' With 'Private Bathroom' on Airbnb Just a Roadside Shipping Container, Guest Says - Gizmodo

I can't imagine it's relevant, but the URL is:

https://gizmodo.com/clean-home-with-private-bathroom-on-airbnb-just-a-roads-1834721410

The first item in the next group has nothing special about it at all. It consists of "https://" followed by just uppercase/lowercase letters and dashes. It's title is just letters and a dash.

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

No branches or pull requests

2 participants