Skip to content

Fix for issue 339 #439

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

goossaert
Copy link
Contributor

The previous fix I submitted does not solve this issue, hence submitting this one, which was more thoroughly tested. It turns out that the bug is actually an edge case: articles are not synced only when the list of articles becomes empty on the ser
ver. This is because purge() has a guard testing for entriesSynced.count == 0 which prevents the sync from happening in the iOS app. This commit removes the guard, enabling the correct syncing behavior.

Emmanuel and others added 3 commits May 26, 2025 16:02
… deleted from the web UI.

This fix was created with help from GitHub Copilot and GPT-4.1

The bug is caused by the sync logic not removing locally cached articles that have been deleted on the server (via the web UI). The root cause is the following:

- The iOS app fetches all articles from the server and updates or inserts them locally.
- It keeps track of the IDs of all articles received from the server in entriesSynced.
- After syncing, it calls purge(), which deletes any local articles whose IDs are not in entriesSynced.
- However, this purge is done in a background context and may not be saved or merged properly with the main context, or the UI may not be updated to reflect these deletions.

The fix implements the following logic:

- After purging deleted articles from the local database, changes are now saved and merged into the main context to ensure the UI updates and deleted articles are removed from the iOS app after a sync.

Link to bug report: wallabag#339
… deleted from the web UI.

The previous fix does not solve this issue, hence submitting this one, which was more thoroughly tested. It turns out that the bug is actually an edge case: articles are not synced only when the list of articles becomes empty on the server. This is because `purge()` has a guard testing for `entriesSynced.count == 0` which prevents the sync from happening in the iOS app. This commit removes the guard, enabling the correct syncing behavior.

wallabag#339
@bourvill
Copy link
Member

Strange, I have tested your previous fix and have the correct behavior, I will test your new PR tonight.

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