Fix: Resolve infinite sync loops causing gigantic unnecessary restorations and prevent deleted "ghost chapters" from reappearing during sync.#28
Open
Lolle2000la wants to merge 8 commits into
Conversation
The synchronization process was previously suffering from runaway loops where devices would continuously restore hundreds of unchanged manga and chapters. This commit implements the fixes needed to prevent these loops: - In MangaRestorer, ensure that chapter versions are properly updated locally when the chapter's read/bookmark contents are identical to the remote, preventing the loop where a device fails to update its local version and continuously resyncs the chapter. - Update SyncManager and SyncService to use stable identifiers (URLs and source IDs) instead of volatile metadata (titles, authors) for composite keys to avoid mistakenly recreating matching items. - In MangaRestorer, properly copy internal og* fields rather than frontend override fields during restoration, and properly restore chapterFlags, viewerFlags, and updateStrategy.
Without this, very small unnecessary restorations are still left. It is also expected behavior
This means that when for example `savedSearchesFeeds` is disabled on one device but not the other, then the device where setting is disabled will restore the saved searches from the device where it isn't. In fact, just syncing once will poising the entire remote store, with it becoming impossible to disable anymore
…sync. (#1575) * feat(sync): prevent deleted "ghost chapters" from reappearing during sync. - Pass lastSyncTime down to mergeChapters in SyncService.kt. - Apply timestamp-based tombstoning logic to chapter merging. When a chapter is missing from either the local or remote backup, its `lastModifiedAt` timestamp is checked against the device's last sync time. - Ensure that chapters deleted on one device (or removed by a source) are recognized as deletions and dropped from the merged backup, rather than being erroneously restored as "new" chapters on subsequent syncs. * chore: change timestamp to use duration-based calculations * chore: spotless (cherry picked from commit e96895345ecb1e12f6e40e30987d9695eb76e914)
There are some things that should be synced but currently aren't, that are specific to this fork. This adds those
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Consolidates this PR for TachiyomiSY by @kaiserbh and this PR by me (my upstream PR to TachiyomiSY was already merged, but this one has specifics to Komikku) into one PR that fixes the biggest remaining issues to sync.
Add a 👍 reaction to pull requests you find important.