Wanikani Reorder Ultimate


#705

Which script manager are you using? (e.g. TamperMonkey?)

Can you give me a list of all the scripts you have running on the Reviews screen? Since the changes to Reorder are actually quite minimal, I’m guessing this is an issue where something is conflicting with the Open Framework.

Several of those errors mention ConfettiRibbon, which I’m guessing is the Level-up Celebrator script. Could you try disabling all scripts except Open Framework and Reorder, and see if it works? Then, start enabling scripts one at a time until it breaks?


#706

I’m using Tampermonkey indeed.
I just finished all my reviews, so i cant link which are being used. when i just go to https://www.wanikani.com/review, i see only a fraction.
I will try this when i get new reviews, though for now it works with the older version


#707

I am having the same issue – probably every second time I go to do reviews, it just stops letting me do anything. Completely unresponsive interface.

I’m using tampermonkey, with override, reorder ultimate and open framework running.


#708

@rfindley, here is a list of all my current scripts…

image

I should probably go over them one by one since i got most of these before my LONG break (started again a month or two ago)

I will attempt to turn them all off and turn on one by one but seeing as @Zedbee only has 3 scripts and the same issue, I think it’s safe to assume the conflict is with override?

EDIT: I realize some scripts have similar functions, but many of them are only on for when I need them (i.e. a button I press when needed, not on constantly). I just wanted to get that in before I get any comments :stuck_out_tongue:


#709

I’ve been getting weird happenings all day, though – like it asks for reading, but then gives me the meaning. Or it asks for meaning, but everything I type in the box comes out as hiragana. That happened about four times. So I don’t know as you can rely on my system for anything.


#710

Wow… that really is goofy, and definitely doesn’t sound like the reorder script.

Anyway, I’ll do some testing tonight to see if I can replicate the issues described here.


#711

I can confirm that it only happens when I have another WK window open (eg community). It just happened again, and hadn’t happened since I closed my community window yesterday afternoon.

Edit: the freeze/unresponsive, that is


#712

I have none of those issues, only the freezing (not the meaning - reading being switched)
It happens when my review window is the only thing open also, so there might be other things unrelated to Open Framework/Reorder going on :stuck_out_tongue:

EDIT: Also @rfindley, as I mentioned before, I currently bypass this issue by having downgraded to the earlier version or reorder ultimate 2 so, at least for me, there is no rush for getting this fixed. I greatly appreciate you putting your time into this, and I’m sure you have other projects that have priority. Though I do get that you might just want it to be working and it bugs you if it doesn’t. Get it? Ok I suck, I shall see myself out…


#713

Yes, exactly. I don’t like broken code :sweat_smile:
I’m going to fix it either way, so I might as well do it while I still remember that there’s an issue.


#714

Well, good luck. I check this thread daily, so if I can help with providing data/info of my freakish setup, I will.


#715

:point_right: [ v2.2.1 ] - Fix startup race condition.

@Zedbee @Amenophyckxs


#716

Nice! At first glance, this seems to fix my problem. Thank you!


#717

Impressive bugfixing spree :slight_smile:

It has reminded me to report a (minor) problem I’ve observed:

When you initially start a review session, if you hover over the type or level rectangles that Reorder Ultimate displays, the tooltip which reports how many items in each one over-counts the actual quantity. It’s not simply doubling - rather it seems to somehow be double-counting only some items.

Interacting with Reorder Ultimate in a way which causes a reorder (e.g. click Force Reorder) seems to trigger a recount which then makes the tooltips show the correct values.


#718

Interesting. When did you last check that it does that? Sometime in the last two bug fixes, I added what I think is equivalent to a Force Reorder at startup, because it didn’t always seem to be implementing the selected order until you manually click Force Reorder.

But this isn’t actually my script, and there’s a lot I don’t know about how it works internally.


#719

Sorry, I really should have mentioned that the issue is still reproducible in the current 2.2.1 with WKOF 1.0.34 in my previous post.


#720

I threw some console.log in around the place, and tracked down the issue - the script does this:

$.jStorage.listenKeyChange(dataset.active, setup.ui.toggler);

but then at various points it calls pairs of:

$.jStorage.set(dataset.active, ...);
$.jStorage.set(dataset.queue, ...);

The problem is that the two updates only make sense when viewed as a single atomic update, but since the listened-to key is being updated first, the listener fires whilst the jStorage is in an intermediate wrong state, leading to some items being double-counted.

Re-ordering the calls so that active is always set second - but watching out for side-effects in the set expressions which need to be pulled out so they don’t get reordered - looks like it fixes it.


#721

So, just swap the two ‘set’ calls? Or did you add some additional code to “watch out for side-effects”? I’d love to add your fix.


#722

Swap the order, but also factor out the expression used in the active set call, in cases where it has side-effects which affected the value being used in the queue set call:

@@ -260,8 +260,8 @@ window.reorder = {};
                         return a - b;
                     });
                     var review = queue.splice((dataset.quick === 'r' ? 10 : $.jStorage.get('l/batchSize')));
-                    $.jStorage.set(dataset.active, queue);
                     $.jStorage.set(dataset.queue, review);
+                    $.jStorage.set(dataset.active, queue);
                     dataset.updateVisual();
                 } catch (err) {
                     showerr(err);
@@ -378,8 +378,9 @@ window.reorder = {};
                     $('#option-wrap-up').click(function() {
                         if ($(this).attr('class') === 'wrap-up-selected') {
                             var fullQueue = $.jStorage.get(dataset.active).concat($.jStorage.get(dataset.queue));
-                            $.jStorage.set(dataset.active, fullQueue.splice(0, 10));
+                            var active = fullQueue.splice(0, 10);
                             $.jStorage.set(dataset.queue, fullQueue);
+                            $.jStorage.set(dataset.active, active);
                         } else {
                             if (ordered) {
                                 sorter.reorder();
@@ -557,8 +558,9 @@ window.reorder = {};
                     });
                 }
             }
-            $.jStorage.set(dataset.active, (dataset.quick === 'r' ? fullQueue : fullQueue.splice(0, $.jStorage.get('l/batchSize'))));
+            var active = (dataset.quick === 'r' ? fullQueue : fullQueue.splice(0, $.jStorage.get('l/batchSize')));
             $.jStorage.set(dataset.queue, (dataset.quick === 'r' ? [] : fullQueue));
+            $.jStorage.set(dataset.active, active);
             dataset.updateVisual();
         },
         removeLevel: function(level, list) {

#723

:point_right: [ v2.2.2 ] - FIxed item counts in hover-tips.

Credit to @maxb.


#724

Thanks… but v2.2.2 only includes the first 2 of the 3 chunks of changes I proposed in the previous comment, so the bug still occurs.