-
Notifications
You must be signed in to change notification settings - Fork 297
dms: fix missing DMs with pull-to-refresh and disable trusted filter (negentropy) #3403
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
base: master
Are you sure you want to change the base?
Conversation
This commit splits a subscription that previously gathered DMs as well as new notes from the follow list, moving the DM subscription to is own dedicated stream. This prevents the issue of DM notes getting clipped off when the user follows too many other users. Closes: https://github.com/damus-io/damus/gh-3352 Changelog-Fixed: Fixed an issue where DMs may not appear for users with a large contact list Signed-off-by: Daniel D’Aquino <[email protected]>
Two changes to help users see more DMs: 1. Disable trusted network filtering for DM threads Remove friend_filter from DM list filtering so all DM threads are visible regardless of trusted network settings. Remove the tip view and filter button that referenced trusted network filtering. The subtitle binding is removed since ContentView already clears it on tab switch and DMs has no subtitle to display. 2. Add pull-to-refresh to fetch DM history The default DM subscription uses `optimizeNetworkFilter: true` which adds a `since` timestamp based on local data. This can miss older DMs if the local database is incomplete. The new `fetchFullDMHistory()` method fetches DM history with `optimizeNetworkFilter: false`, which starts the network fetch immediately. However, the underlying `advancedStream` still applies a `since` filter once any NDB data is seen, so older DMs may still be missed. A proper fix would require changes to SubscriptionManager. Uses a task group with 30-second hard timeout and 500 event limit. Users can pull multiple times to incrementally sync more history. Works on both DMs and Requests tabs. Changelog-Fixed: Fixed DMs not showing by disabling trusted network filter and adding pull-to-refresh to sync older messages Closes: damus-io#3352 Signed-off-by: alltheseas 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
|
I don't know if the technical solution takes the correct approach. The result is that I do see a bunch of my old DMs (unlike prior to this fix), and I have a method to ask for more/older DMs. |
|
the only thing "pull to request" should ever do is negentropy sync missing notes. then we would just locally query any number of them to display. |
I'll submit updated commits shortly for negentropy. Will need help with the logic review of what happens on case of unhappy paths e.g. where relay does not support negentropy etc. |
|
@jb55 initial negentropy update ready for your review. probably needs at least one more iteration of feedback |
|
related to #3269 |
|
Timeline negentropy PR: #3444 |
Summary
Two changes to help users see more DMs:
Disable trusted network filtering for DM threads - Remove friend_filter from DM list filtering so all DM threads are visible regardless of trusted network settings. Remove the tip view and filter button that referenced trusted network filtering.
Add pull-to-refresh to fetch DM history - The default DM subscription uses
optimizeNetworkFilter: truewhich adds asincetimestamp based on local data. This can miss older DMs if the local database is incomplete. The newfetchFullDMHistory()method fetches DM history withoptimizeNetworkFilter: false, which starts the network fetch immediately. Uses a task group with 30-second hard timeout and 500 event limit. Works on both DMs and Requests tabs.Add unit tests - Added two tests for
filter_dms_by_muteto verify muted users are filtered and strangers outside trusted network are still shown.Checklist
Standard PR Checklist
Closes:orFixes:tags in the commit messages wherever applicable, or made sure those are not needed. See Submitting patchesTest report
Device: iPhone 16 Pro Simulator
iOS: 18.4
Damus: commit 2b89973
Setup: Logged in with test account that has DMs from multiple users including some not in trusted network
Steps:
DMTestsunit testsResults:
Other notes
Closes: #3352
Note: The underlying
advancedStreamstill applies asincefilter once any NDB data is seen, so very old DMs may still be missed on first pull. Users can pull multiple times to incrementally sync more history. A complete fix would require changes toSubscriptionManagerto fully bypass thesinceoptimization.🤖 Generated with Claude Code