-
Notifications
You must be signed in to change notification settings - Fork 58
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
Question: Deleting assignments rows on sendProgress? #678
Comments
Yeah I think that could probably work. It would need to clear the I think it was probably done this way because all the home screen stats were added later and we never came back to see if there was a smarter way to deal with the reviews that had been done but not sync'd yet. |
Makes sense. Thanks. A quick smoke test of the following code: for p in progress {
// Set the assignment as not available.
var assignment = p.assignment
assignment.clearAvailableAt()
db.mustExecuteUpdate("UPDATE assignments SET pb = ? WHERE id = ?",
args: [try! assignment.serializedData(), assignment.id]) doesn't exhibit any obvious bugs, but I didn't do a lot of testing with things like dropped internet connections, staying offline, etc. EDIT: This would exhibit bugs in the following:
|
I've committed a quick fix for the crash, but the underlying issue still remains. |
Howdy,
Currently the app has an issue where the time between finishing reviews (of any count) and finishing syncing data, the home screen info on assignments, recent lessons, etc. will potentially be inaccurate.
I believe this is because the
assignments
data is deleted insendProgress
, thus until theassignments
data is re-synced from WaniKani, any pulls of data involving theassignments
table in the local db will be inaccurate.tsurukame/ios/LocalCachingClient.swift
Lines 735 to 743 in a1ffaa0
This explains why sometimes after finishing reviews my current vs next level graphs will be off/the wrong levels, or the new Recent Lessons number will be off as the
JOIN
fromsubject_progress
toassignments
doesn't join for any just-finished reviews (theassignments
portion isNULL
onJOIN
), etc.Is there a reason why
sendProgress
couldn't update the pertinentassignments
data directly and then a new sync from WaniKani would do a full update as well with any pertinent info from the API or similar? This would prevent the few seconds of UI desync, although I'm not sure how the problem would be affected by a spotty or offline internet connection.Looks like the given line has been around since 043448f (Dec 2017).
The text was updated successfully, but these errors were encountered: