Skip to content

Comments

sync: better /changes handling#5496

Merged
latter-bolden merged 31 commits intostagingfrom
lb/refetch-on-seq-update
Feb 24, 2026
Merged

sync: better /changes handling#5496
latter-bolden merged 31 commits intostagingfrom
lb/refetch-on-seq-update

Conversation

@latter-bolden
Copy link
Member

@latter-bolden latter-bolden commented Feb 18, 2026

Summary

Modifies the /changes endpoint codepath to

a) let the resulting DB updates propagate more quickly
b) provide a stronger guarantee that result Posts with higher sequence nums make their way to existing channel queries

Fixes TLON-5331
Fixes TLON-5332

Changes

  • in syncStart, move syncSince ahead of the longer High Priority batchEffects
  • when Posts flow into the DB via /changes and /heads, ensure they're appended to useChannelPosts results using the same mechanism as subscription updates
  • add comprehensive timing telemetry for open to ChatList and tap Push Notification

How did I test?

iOS/Android preview builds

Risks and impact

  • Safe to rollback without consulting PR author? Yes
  • Affects important code area:
    • Message sync

…fetch infinite query data in useChannelPosts
@dnbrwstr
Copy link
Contributor

Fwiw, tested this against the stale-posts-on-boot-from-notification issue. In my testing today, both this branch and develop seemed to have the same behavior: new messages would pop in after 7-8 seconds.

@latter-bolden
Copy link
Member Author

develop seemed to have the same behavior: new messages would pop in after 7-8 seconds

we chatted out of band, but the slow timing when opening from cold start seems to be the syncSince call having its effects batched with the rest of syncStart high priority. That operation consistently takes right around 7-8 seconds.

Tethering useChannelPosts to a latestSeqNum should defensively cover a broader range of cases than just returning from a force quit.

Copy link
Contributor

@dnbrwstr dnbrwstr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm!

@linear
Copy link

linear bot commented Feb 19, 2026

@latter-bolden
Copy link
Member Author

latter-bolden commented Feb 20, 2026

I'm still having trouble getting this to go green for the e2e tests

  • All failing tests succeed locally when run together using pnpm e2e:test ...files
  • They still fail after commenting out the only substantive change I could see affecting things (the useChannelPost refetch)

I'm slowly rolling back (what I thought were) inconsequential changes to try and isolate the issue

@latter-bolden latter-bolden changed the title sync: refetch channel posts when latest sequence number increases sync: better /changes handling Feb 24, 2026
@latter-bolden latter-bolden merged commit 07090f0 into staging Feb 24, 2026
4 checks passed
@latter-bolden latter-bolden deleted the lb/refetch-on-seq-update branch February 24, 2026 15:51
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