Skip to content

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
sohilsayed:mainfrom
Lolle2000la:fix-sync-issues
Open

Fix: Resolve infinite sync loops causing gigantic unnecessary restorations and prevent deleted "ghost chapters" from reappearing during sync.#28
Lolle2000la wants to merge 8 commits into
sohilsayed:mainfrom
Lolle2000la:fix-sync-issues

Conversation

@Lolle2000la

Copy link
Copy Markdown
Contributor

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.

Lolle2000la and others added 8 commits June 18, 2026 21:21
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants