Skip to content

refactor: cleaned up sync read-status layer#1142

Merged
spacecowboy merged 1 commit into
masterfrom
refactor
May 18, 2026
Merged

refactor: cleaned up sync read-status layer#1142
spacecowboy merged 1 commit into
masterfrom
refactor

Conversation

@spacecowboy

@spacecowboy spacecowboy commented May 18, 2026

Copy link
Copy Markdown
Owner
  1. Moved ReadStatusSyncedDao.deleteReadStatusSyncs to RemoteReadMarkDao.deleteByIds. The old method deleted from remote_read_mark inside a DAO named ReadStatusSyncedDao, which was confusing and caused misdirection during bug investigation. Renamed the SyncRemoteStore wrapper to deleteAppliedRemoteReadMarks to reflect its actual purpose.

  2. Removed two dead Flow query variants (getNextFeedItemWithoutSynced ReadMark, getFlowOfFeedItemsWithoutSyncedReadMark) from ReadStatusSyncedDao and SyncRemoteStore. Neither was called from any production code; only the plain-suspend getFeedItemsWithoutSyncedReadMark() is used.

  3. Removed FeedItemDao.markAsRead(id: Long), which had byte-for-byte identical SQL to markAsReadAndNotified(id: Long) and was never called from any production code.

  4. Made SyncRestClient.safeBlock's block parameter non-nullable and removed the dead if (block != null) guard. Every call site already passes a non-null lambda.

  5. Renamed internal markAsRead(feedItems) to private sendReadMarksBatch(feedItems) to disambiguate it from the public markAsRead() coordinator. The old identical names made the call from coordinator to sender look like recursion.

1. Moved ReadStatusSyncedDao.deleteReadStatusSyncs to
   RemoteReadMarkDao.deleteByIds. The old method deleted from
   remote_read_mark inside a DAO named ReadStatusSyncedDao, which
   was confusing and caused misdirection during bug investigation.
   Renamed the SyncRemoteStore wrapper to deleteAppliedRemoteReadMarks
   to reflect its actual purpose.

2. Removed two dead Flow query variants (getNextFeedItemWithoutSynced
   ReadMark, getFlowOfFeedItemsWithoutSyncedReadMark) from
   ReadStatusSyncedDao and SyncRemoteStore. Neither was called from
   any production code; only the plain-suspend
   getFeedItemsWithoutSyncedReadMark() is used.

3. Removed FeedItemDao.markAsRead(id: Long), which had byte-for-byte
   identical SQL to markAsReadAndNotified(id: Long) and was never
   called from any production code.

4. Made SyncRestClient.safeBlock's block parameter non-nullable and
   removed the dead if (block != null) guard. Every call site already
   passes a non-null lambda.

5. Renamed internal markAsRead(feedItems) to private
   sendReadMarksBatch(feedItems) to disambiguate it from the public
   markAsRead() coordinator. The old identical names made the call
   from coordinator to sender look like recursion.
@spacecowboy spacecowboy enabled auto-merge (squash) May 18, 2026 21:06
@spacecowboy spacecowboy merged commit 612e44c into master May 18, 2026
12 checks passed
@spacecowboy spacecowboy deleted the refactor branch May 18, 2026 21:15
jenningsloy318 pushed a commit to jenningsloy318/Feeder that referenced this pull request May 29, 2026
1. Moved ReadStatusSyncedDao.deleteReadStatusSyncs to
   RemoteReadMarkDao.deleteByIds. The old method deleted from
   remote_read_mark inside a DAO named ReadStatusSyncedDao, which
   was confusing and caused misdirection during bug investigation.
   Renamed the SyncRemoteStore wrapper to deleteAppliedRemoteReadMarks
   to reflect its actual purpose.

2. Removed two dead Flow query variants (getNextFeedItemWithoutSynced
   ReadMark, getFlowOfFeedItemsWithoutSyncedReadMark) from
   ReadStatusSyncedDao and SyncRemoteStore. Neither was called from
   any production code; only the plain-suspend
   getFeedItemsWithoutSyncedReadMark() is used.

3. Removed FeedItemDao.markAsRead(id: Long), which had byte-for-byte
   identical SQL to markAsReadAndNotified(id: Long) and was never
   called from any production code.

4. Made SyncRestClient.safeBlock's block parameter non-nullable and
   removed the dead if (block != null) guard. Every call site already
   passes a non-null lambda.

5. Renamed internal markAsRead(feedItems) to private
   sendReadMarksBatch(feedItems) to disambiguate it from the public
   markAsRead() coordinator. The old identical names made the call
   from coordinator to sender look like recursion.
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