[Userscript] WaniKani Dashboard SRS and Leech Breakdown

Try opening your Javascript console (press F12, then click on the Console tab), paste the following command, and press enter:

wkof.Apiv2.clear_cache(true);

Then refresh. It should reload all of the stored API data. (@seanblue, the ‘true’ tells it to also delete /subjects, which is not user-specific).

1 Like

Great, thanks!

@orimazer Please let both me and @rfindley know if the numbers are still wrong after clearing the cache. That should hopefully tell us if it’s an Open Framework bug or an API bug.

1 Like

after clearing the cache and refreshing the problem persists. (sorry for the slow response, i’ve only just been able to get back to wanikani).
i’m about to do some reviews, so numbers will change. i’ll let you know if the totals are still off after.

Thanks for the update. I can probably verify if it’s an API issue if you send me an API token (though I have no way for you to send it privately). I would search all your guru items to look for one that’s at a level above your current level and may have been moved from the overhaul.

ahhh, at that suggestion, i had a look myself. i have a now level 54 radical i unlocked back in november and i recently missed burning, putting it at guru! so that would be the 1, then?

1 Like

That does sound like the problem, yeah. Interestingly I don’t even see any radicals listed on level 54. What’s the item?

my mistake, level 52’s frostbite (夌)

1 Like

Thanks!

@viet @oldbonsai it does look like there’s an API bug related to items that were unlocked and then moved to later levels if you want to investigate. See the last several posts for details.

1 Like

Can you give context on the screenshot of the numbers, what do they mean, where the discrepancy is exactly, and how the API is being used to generate those numbers?

Mmmm, yeah, is this a bug with what the API is reporting, or a bug with the calculation of totals of items without taking the current user level into account?

@oldbonsai,

seanblue isn’t taking the user’s current level into account… but should he? How does WK calculate the native numbers on the WK dashboard?

If an item is at Guru, and WK moves that item to a level higher than the user’s current level, does WK stop giving reviews for that item until the user reaches the new level, or is that item still active and at Guru? Is that item included in WK’s count on the dashboard?

1 Like

the radical in question is “available now” so in about 45 reviews time i will be able to say if it comes up

It won’t. This is an existing bug I believe, based on past comments from @viet or @oldbonsai (if I remember correctly).

It seems odd to expect all scripts to have to filter out items above the user’s current level. Especially since…

…that item isn’t included on the dashboard (that’s the cause of the discrepancy after all).

What is the expected usage of the API for this case?

1 Like

it indeed did not come up

Right. And if it’s not available for review and it doesn’t show up in the count on the dashboard, I don’t see why it should show up in the count from the API.

1 Like

Which count from the API? V1 or V2?

seanblue’s “count from the API” is him counting all V2 items in each assignments.srs_stage.

So, I think he’s saying that an item shouldn’t be marked as srs_stage 5 (or whatever) if it has essentially been disabled due to being moved to a level above the user’s current level. (assuming that’s what really happens??)

1 Like

@viet and I have talked about it and the short answer is: we’re doing it right, and the counts in this particular script are counting more than they should.

How does it account for subscription status? Our dashboard only shows counts for level three and below when a person doesn’t have an active subscription. Does this script still show all their progress (which is available via the API)?

We feel it’s punitive in most situations to clear out the progress information (SRS stage, availability) when changing a subject’s level.

There’s a handy filter to throw on the assignments endpoint (see in_review in the assignment endpoint documentation). It returns items:

  • In the review state (not in lessons and not burned)
  • Accessible to the user (at or below user level, accounting for subscription status)

Would that work?

1 Like

Yes, that’s what I’m saying.

That’s what seems to be happening based on what @orimazer said.

I think that would work. Is that basically what the vanilla dashboard is doing?