cplaverty/KeitaiWaniKani

Persistent badge value of 1

Closed this issue · 2 comments

Starting some time last week my app has had a persistent 1 badge using the current TestFlight. The same is true from master and removing/reinstalling master did not help. This might be a bug with the V2 API.

The dashboard and upcoming review screens both show one review waiting (see below). The WaniKani site does not show and reviews pending (also below). I pulled up the debugger and found a single Kanji in the local database with availableDate listing 2018-12-07 (in the past).

I poked around in the fsCachedData and found the JSON response form the v2 API (as far as I can tell). I think this would be the assignment in question:

      {
         "data_updated_at" : "2018-11-23T19:25:06.331631Z",
         "url" : "https://api.wanikani.com/v2/assignments/116309529",
         "data" : {
            "hidden" : false,
            "srs_stage_name" : "Guru II",
            "subject_id" : 587,
            "burned_at" : null,
            "srs_stage" : 6,
            "resurrected_at" : null,
            "created_at" : "2018-10-06T23:25:16.782919Z",
            "available_at" : "2018-12-07T18:00:00.000000Z",
            "resurrected" : false,
            "unlocked_at" : "2018-10-06T23:25:16.776976Z",
            "subject_type" : "kanji",
            "started_at" : "2018-11-12T23:39:45.495231Z",
            "passed" : true,
            "passed_at" : "2018-11-16T16:43:22.167262Z"
         },
         "id" : 116309529,
         "object" : "assignment"
      },

Given the authorization model for WaniKani you can't see the assignment directly, I'm sure. Maybe I have misunderstood the data model but it seems like this is bad data from the V2 API. Does that data seem correct to you? If you agree that assignment seems wrong I'm happy to submit something to WaniKani instead. If I misunderstood the data model point me in the right direction and I'll hunt this down and make a PR.

Screenshots

Dashboard
Upcoming Reviews
WaniKani WebView

Thank you for this fantastic level of detail. The Kanji in question is level 9 (売), which is above your current level. From looking at my own data, I had guessed this the likely cause, but I will take this report as confirmation of that.

The WaniKani web dashboard must be filtering out assignments for subjects whose level is above your current level, so AlliCrab will need to do the same. This isn't going to be a straight join unfortunately because I've split the subjects into separate tables.

FYI, there is a playground (WaniKaniKitAPIPlayground) I've set up in the workspace exactly for this kind of investigation. It makes things easier rather than digging around through cache files.

This should now be fixed with TestFlight version 3.0 b78