Skip to content

fix: corrected three sync read-status bugs#1141

Merged
spacecowboy merged 1 commit into
masterfrom
sync-fixes
May 18, 2026
Merged

fix: corrected three sync read-status bugs#1141
spacecowboy merged 1 commit into
masterfrom
sync-fixes

Conversation

@spacecowboy

@spacecowboy spacecowboy commented May 18, 2026

Copy link
Copy Markdown
Owner
  • RssLocalSync: items applied via alreadyReadGuids path now receive a read_status_synced entry immediately after upsert. Previously the entry was never written, so getFeedItemsWithoutSyncedReadMark() would return these items on the next sync and echo them back to the server as a new read mark.

  • SyncRestClient.getRead: latestMessageTimestamp is now advanced for corrupt (un-decryptable) marks before continuing. Previously the timestamp was only updated on success, so a single corrupt mark would cause the same mark to be retried on every subsequent sync.

  • RemoteReadMarkDao / Repository.applyRemoteReadMarks: added deleteRemoteReadMarksForReadItems() which removes remote_read_mark rows for items that already have read_time set. Called at the end of applyRemoteReadMarks() so stale marks can no longer override a deliberate mark-as-unread on the next sync cycle.

Added tests:

  • RssLocalSyncKtTest: remoteReadMarkIsAppliedToNewItemAndMarkedAsSynced, applyRemoteReadMarksCleansStaleEntriesForAlreadyReadItems, itemsNotInRemoteReadMarkAreNotMarkedAsRead
  • SyncRestClientTest (new): getReadCallsRemoteMarkAsReadForEachReceivedMark, getReadAdvancesTimestampPastCorruptMark, markAsReadSendsItemsAndMarksThemAsSynced
  • RepositoryTest: updated applyRemoteReadMarks + added applyRemoteReadMarksCleansUpStaleMarksEvenWhenNothingToApply

- RssLocalSync: items applied via alreadyReadGuids path now receive a
  read_status_synced entry immediately after upsert. Previously the
  entry was never written, so getFeedItemsWithoutSyncedReadMark()
  would return these items on the next sync and echo them back to the
  server as a new read mark.

- SyncRestClient.getRead: latestMessageTimestamp is now advanced for
  corrupt (un-decryptable) marks before continuing. Previously the
  timestamp was only updated on success, so a single corrupt mark
  would cause the same mark to be retried on every subsequent sync.

- RemoteReadMarkDao / Repository.applyRemoteReadMarks: added
  deleteRemoteReadMarksForReadItems() which removes remote_read_mark
  rows for items that already have read_time set. Called at the end of
  applyRemoteReadMarks() so stale marks can no longer override a
  deliberate mark-as-unread on the next sync cycle.

Added tests:
- RssLocalSyncKtTest: remoteReadMarkIsAppliedToNewItemAndMarkedAsSynced,
  applyRemoteReadMarksCleansStaleEntriesForAlreadyReadItems,
  itemsNotInRemoteReadMarkAreNotMarkedAsRead
- SyncRestClientTest (new): getReadCallsRemoteMarkAsReadForEachReceivedMark,
  getReadAdvancesTimestampPastCorruptMark,
  markAsReadSendsItemsAndMarksThemAsSynced
- RepositoryTest: updated applyRemoteReadMarks + added
  applyRemoteReadMarksCleansUpStaleMarksEvenWhenNothingToApply
@spacecowboy spacecowboy merged commit bbef343 into master May 18, 2026
12 checks passed
@spacecowboy spacecowboy deleted the sync-fixes branch May 18, 2026 20:50
jenningsloy318 pushed a commit to jenningsloy318/Feeder that referenced this pull request May 29, 2026
- RssLocalSync: items applied via alreadyReadGuids path now receive a
  read_status_synced entry immediately after upsert. Previously the
  entry was never written, so getFeedItemsWithoutSyncedReadMark()
  would return these items on the next sync and echo them back to the
  server as a new read mark.

- SyncRestClient.getRead: latestMessageTimestamp is now advanced for
  corrupt (un-decryptable) marks before continuing. Previously the
  timestamp was only updated on success, so a single corrupt mark
  would cause the same mark to be retried on every subsequent sync.

- RemoteReadMarkDao / Repository.applyRemoteReadMarks: added
  deleteRemoteReadMarksForReadItems() which removes remote_read_mark
  rows for items that already have read_time set. Called at the end of
  applyRemoteReadMarks() so stale marks can no longer override a
  deliberate mark-as-unread on the next sync cycle.

Added tests:
- RssLocalSyncKtTest: remoteReadMarkIsAppliedToNewItemAndMarkedAsSynced,
  applyRemoteReadMarksCleansStaleEntriesForAlreadyReadItems,
  itemsNotInRemoteReadMarkAreNotMarkedAsRead
- SyncRestClientTest (new): getReadCallsRemoteMarkAsReadForEachReceivedMark,
  getReadAdvancesTimestampPastCorruptMark,
  markAsReadSendsItemsAndMarksThemAsSynced
- RepositoryTest: updated applyRemoteReadMarks + added
  applyRemoteReadMarksCleansUpStaleMarksEvenWhenNothingToApply
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.

1 participant