auto-sort-bookmarks-webext icon indicating copy to clipboard operation
auto-sort-bookmarks-webext copied to clipboard

Separators Ignored (or Randomly Moving)

Open Taurean75 opened this issue 7 years ago • 17 comments

As it is now (3.0), separators are being ignored. Please correct this.

Thanks.

Taurean75 avatar Nov 26 '17 23:11 Taurean75

OK, I was able to reproduce the bug.

eric-bixby avatar Nov 26 '17 23:11 eric-bixby

I'm seeing weird things with separators. There might be a bug in Firefox. This needs more testing.

eric-bixby avatar Dec 04 '17 02:12 eric-bixby

Take a look at https://addons.mozilla.org/en-US/firefox/addon/sort-bookmarks-webext/

That developer fixed it quite quickly.

Taurean75 avatar Dec 04 '17 02:12 Taurean75

Actually, separators are not being ignored. What I'm seeing is that the separator randomly moves, which causes the sorting to change. This is why I think it might be a Firefox issue.

eric-bixby avatar Dec 04 '17 02:12 eric-bixby

I concur. Personally, issue #54 is more urgent.

Taurean75 avatar Dec 04 '17 02:12 Taurean75

It destroyed my bookmark order on several profiles before I realised it. Hope to see it fixed soon.

As to "Sort Bookmarks" by heftig that one does not even sort alphabetically correctly. Not sure why that is happening though.

TimidScript avatar Dec 05 '17 22:12 TimidScript

I noticed that the issue with the separator occurs when moving bookmarks across separators. Folders in which bookmarks are not moved retain the state of their separators and sort correctly.

After unchecking 'Auto sort' pref of the addon (and saving the prefs), I added separators in a folder and grouped the bookmarks in it by moving them across the separators. The bookmarks between the separators were not sorted. I then checked 'Auto sort' (and saved). Within seconds the bookmarks in the folder got sorted correctly, with the separators intact.

Then, with 'Auto sort' still checked, I added a bookmark in the folder, which got appended at the bottom as expected. ~~This time 10+ minutes passed before~~ the bookmarks got auto-sorted, ~~but~~ the sorting was correct and the separators remained intact.

akwala avatar Dec 11 '17 03:12 akwala

@akwala Thanks for the report. Here's what I'm seeing when existing bookmarks are moved either above or below (across) a separator, while auto-sort is enabled, the net result is the separator ends up getting moved to the top and the bookmarks below. I also noticed this doesn't always happen and appears to be timed based which makes me wonder if there might be a cache problem. It's going to take more debugging to narrow down. I'll look into this once I finish the exclude-folders feature.

eric-bixby avatar Dec 23 '17 17:12 eric-bixby

(btw, I haven't forgotten about this issue.)

The problem appears to be auto-sort sorting while a bookmark is being dragged.

There are two possible workarounds:

  1. disable auto-sort while moving.
  2. increase the preference to wait before auto sorting.

It would be nice if FF told me when a bookmark is being dragged, but I'm not aware of an API for this. My next step will be to search for such an API. If not, then I don't have an alternative and I'm open to suggestions.

eric-bixby avatar Sep 28 '18 17:09 eric-bixby

1. disable auto-sort while moving.

If auto-sort and changes outside auto-sort can be made never to overlap then this seems better because it does not depend on a user preference. However, if this requires significant additional coding, it may not be worth introducing more complexity and bug possibilities if the second option is adequate.

2. increase the preference to wait before auto sorting.

~~This could be adequate. It might help to increase the lower limit to, say, 30 seconds. I can't think of a reason to have as short a wait as the current minimum of 5 sec. The maximum of 255 sec, or 4.25 minutes, should be fine though a higher max would be useful if one is doing a substantial reorg of one's bookmarks.~~

I've enabled auto-sort with an inactivity wait of 180 sec (3 min). I'll report back on how that goes.

Update: With inactivity wait of 180 sec auto-sort doesn't happen immediately but, when it does, bookmarks and separators end up in positions other than those set:

  • Relocating an entire section between separators within a folder, and deleting/adding separators, was not affected by auto-sort, which is expected behavior.
  • Auto-sort after moving bookmarks between separators caused the bookmarks and separators to end up in seemingly random positions.

akwala avatar Sep 28 '18 18:09 akwala

Here's what I'm seeing. I have a folder with many bookmarks in the section following the last separator, At one point I created a new separator above it, and moved about half the bookmarks to the section above the separator. I noticed a few stragglers stayed in the bottom section, so had to move them again.

But here's the weird symptom I've noticed since. I'll save a new bookmark, which FF puts in the bottom section as expected. I then drag it up above the separator, and it stays. But one bookmark already above the separator jumps down to the bottom section. I then drag the latter bookmark up, but the first bookmark jumps down. I keep dragging "A" and "B" up, but the other jumps back. The only way I can circumvent this is to turn off the extension while doing a move, which forces me to sort visually.

If I create another bookmark "C" and drag it up, then either "A" or "B" will jump back down. It seems that the same couple of bookmarks are the ones most often affected.

I wish this problem could be prioritized. I see that it was reported a few versions back, and it is quite irritating,

Wizardgoat avatar Nov 09 '22 01:11 Wizardgoat

I apparently found a work-around. I inserted a new separator just above the one that was sometimes being ignored. I tried adding a bookmark to the bottom section, and no problem occurred. Then I deleted the original separator, and experimented with more bookmarks. The problem seems to have cleared up. Apparently the original separator was somehow "poisoned" and porous to some bookmarks, But the new separator seems to be "solid".

Wizardgoat avatar Nov 10 '22 02:11 Wizardgoat

I'm unable to get the add-on working with any combination of new or old separators, folders containing other folders or not. Output is seemingly random -- sometimes it sorts the separator to the bottom, sometimes it tosses it in the middle for no reason, but it never does what you'd expect. Can you take another look at this, Eric?

blackwind avatar Jan 20 '23 03:01 blackwind

I think you've diagnosed it by acknowledging that the failure (or lack) is random, with each separator created. I've circumvented it by creating a new separator above the bad one, and then deleting the bad one. But while this often works, it doesn't fix the problem. Good luck on an eventual solution.

Wizardgoat avatar Jan 21 '23 01:01 Wizardgoat

I have no idea if it's relevant here, but whenever I see an issue report involving sorted items moving randomly, the cause is often due to an artifact of how the sort algorithm handles equally weighted items.

For example, if you alphabetically (case-insensitive) sort the following list:

apple
cherry
Banana
banana

a valid result can be either:

apple
Banana
banana
cherry

or

apple
banana
Banana
cherry

If the code doesn't handle equally-weighted items with consistency, the bananas can sometimes shift position during sorting, which appears random to the user.

Again, I have no idea if this helps explain what is going on here, but I've seen it enough times with other code that I thought it worthwhile to take the time to write this post.

Gitoffthelawn avatar Jan 21 '23 02:01 Gitoffthelawn

It’s been awhile but list time I checked, it was a timing issue. When I did a drag-n-drop, it started sorting before I dropped.

I need to run some tests.

On Fri, Jan 20, 2023 at 6:57 PM Gitoffthelawn @.***> wrote:

I have no idea if it's relevant here, but whenever I see an issue report involving sorted items moving randomly, the cause is often due to an artifact of how the sort algorithm handles equally weighted items.

For example, if you alphabetically (case-insensitive) sort the following list:

apple cherry Banana banana

a valid result can be either:

apple Banana banana cherry

or

apple banana Banana cherry

If the code doesn't handle equally-weighted items with consistency, the bananas can sometimes shift position during sorting, which appears random to the user.

Again, I have no idea if this helps explain what is going on here, but I've seen it enough times with other code that I thought it worthwhile to take the time to write this post.

— Reply to this email directly, view it on GitHub https://github.com/eric-bixby/auto-sort-bookmarks-webext/issues/56#issuecomment-1399159911, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABGRCMPOH4HC2E3P3DQPQI3WTNGBZANCNFSM4EFL4YNA . You are receiving this because you were assigned.Message ID: @.***>

eric-bixby avatar Jan 21 '23 12:01 eric-bixby

Makes sense too!

Gitoffthelawn avatar Jan 22 '23 03:01 Gitoffthelawn