Suwayomi / Suwayomi-Server

A rewrite of Tachiyomi for the Desktop
Mozilla Public License 2.0
3.73k stars 196 forks source link

fix: adds condition to the tracker update mutation to update the db to match the tracker last chapter read tracker when none is passsed #915

Closed taos15 closed 3 months ago

taos15 commented 3 months ago
taos15 commented 3 months ago

Since the tracker is the source of true, when we are not changing the last chapter read the database should be updated to match the tracker.

schroda commented 3 months ago

imo this should be done in a separate mutation, at least to me it is not clear from looking at the available mutations that updateTrack will fetch the latest data from the tracker in case it's called with only the remoteId

taos15 commented 3 months ago

Actually it gets the latest every time. This does not address how to address the refresh of the tracker, it fox how the update itself works. Currently the update mutation is comparing to all data, this male sure it compare to the most resent data. I agree that another migration just to refresh "could" be beneficial, but that should be a separate issues. This address the current bug in the update mutation, we have the logic to check that the input.lastRead has to be greater to change the current last read chapter, but because it does not fetch the data, that logic is not doing what we expect, so it behave as there is not check at all.

schroda commented 3 months ago

these changes do not work at all as intended, they just prevent the server from sending the actual update input at all because it will just fetch the latest data from the tracker and resend the just fetched data to the tracker again as an update

taos15 commented 3 months ago

Closing the PR since core maintaner already have PR 917 where they are working on it.