Skip to content

fix: stop wiping unread counts for spaces and unchanged rooms in incremental recompute - #1257

Merged
7w1 merged 2 commits into
SableClient:devfrom
eleboucher:fix/sliding-sync-unread-regression
Jul 23, 2026
Merged

fix: stop wiping unread counts for spaces and unchanged rooms in incremental recompute#1257
7w1 merged 2 commits into
SableClient:devfrom
eleboucher:fix/sliding-sync-unread-regression

Conversation

@eleboucher

@eleboucher eleboucher commented Jul 23, 2026

Copy link
Copy Markdown
Member

Description

Fixes two regressions from #1253 that caused spaces and channels to lose unread badges after the incremental unread recompute landed.

  1. getUnreadInfosForRooms deleted space rooms instead of skipping them. The RESET path (getUnreadInfos) skips spaces, but the new incremental path pushed them to the deleted list. Space unread is derived from children via parent propagation in the atom reducer, a direct DELETE wiped the aggregated count, and non-dirty children never re-PUT to restore it.
  2. Empty [] account_data rooms were marked dirty. The server echoes every subscribed room in the account_data extension with an empty array when nothing changed. The old code added all of them to dirtyRoomIds, marking ~150 rooms dirty per sync cycle and defeating the incremental optimization.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

AI disclosure:

  • Partially AI assisted (clarify which code was AI assisted and briefly explain what it does).
  • Fully AI generated (explain what all the generated code does in moderate detail).

@eleboucher
eleboucher requested review from 7w1 and hazre as code owners July 23, 2026 19:25
@7w1

7w1 commented Jul 23, 2026

Copy link
Copy Markdown
Member

Empty [] account_data rooms were marked dirty. The server echoes every subscribed room in the account_data extension with an empty array when nothing changed. The old code added all of them to dirtyRoomIds, marking ~150 rooms dirty per sync cycle and defeating the incremental optimization.

Not 100% sure but i think this might actually be a c10y bug? Doesn't happen on morg and I think i stumbled on it while implementing some other sliding sync things and its very odd. Server probably shouldn't be returning a list of unchanged empty rooms in the extension

@7w1

7w1 commented Jul 23, 2026

Copy link
Copy Markdown
Member

also fix checks :(

@7w1 7w1 added the internal label Jul 23, 2026
@7w1
7w1 added this pull request to the merge queue Jul 23, 2026
Merged via the queue into SableClient:dev with commit 1d256b9 Jul 23, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants