Skip to content

Conversation

@alltheseas
Copy link
Collaborator

Summary

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.

  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. Uses a task group with 30-second hard timeout and 500 event limit. Works on both DMs and Requests tabs.

  3. Add unit tests - Added two tests for filter_dms_by_mute to verify muted users are filtered and strangers outside trusted network are still shown.

Checklist

Standard PR Checklist

  • I have read (or I am familiar with) the Contribution Guidelines
  • I have tested the changes in this PR
  • I have profiled the changes to ensure there are no performance regressions, or I do not need to profile the changes.
    • Not needed: This change adds a pull-to-refresh action that fetches events on demand; no new background processing or UI rendering changes.
  • I have opened or referred to an existing github issue related to this change.
  • My PR is either small, or I have split it into smaller logical commits that are easier to review
  • I have added the signoff line to all my commits. See Signing off your work
  • I have added appropriate changelog entries for the changes in this PR. See Adding changelog entries
  • I have added appropriate Closes: or Fixes: tags in the commit messages wherever applicable, or made sure those are not needed. See Submitting patches

Test 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:

  1. Open DMs tab - verify all DM threads appear (including from users not in trusted network)
  2. Open Requests tab - verify all message requests appear
  3. Pull down on DMs tab - verify loading spinner appears and completes
  4. Pull down on Requests tab - verify loading spinner appears and completes
  5. Run DMTests unit tests

Results:

  • PASS

Other notes

Closes: #3352

Note: The underlying advancedStream still applies a since filter 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 to SubscriptionManager to fully bypass the since optimization.

🤖 Generated with Claude Code

danieldaquino and others added 2 commits December 8, 2025 11:37
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]>
@alltheseas
Copy link
Collaborator Author

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.

@jb55
Copy link
Collaborator

jb55 commented Dec 10, 2025

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.

@alltheseas alltheseas added the dm label Dec 10, 2025
@alltheseas
Copy link
Collaborator Author

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.

@alltheseas alltheseas requested a review from jb55 December 10, 2025 22:34
@alltheseas alltheseas marked this pull request as draft December 10, 2025 22:34
@alltheseas
Copy link
Collaborator Author

alltheseas commented Dec 10, 2025

@jb55 initial negentropy update ready for your review. probably needs at least one more iteration of feedback

@alltheseas alltheseas changed the title dms: fix missing DMs with pull-to-refresh and disable trusted filter dms: fix missing DMs with pull-to-refresh and disable trusted filter (negentropy) Dec 10, 2025
@alltheseas
Copy link
Collaborator Author

related to #3269

@danieldaquino danieldaquino added the pr-in-queue This PR is waiting in a queue behind their other PRs marked with the label `pr-active-review`. label Dec 10, 2025
@danieldaquino danieldaquino added pr-active-review This PR is actively being reviewed, or is next on the list to be reviewed. and removed pr-in-queue This PR is waiting in a queue behind their other PRs marked with the label `pr-active-review`. labels Dec 23, 2025
@alltheseas
Copy link
Collaborator Author

Timeline negentropy PR: #3444

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dm pr-active-review This PR is actively being reviewed, or is next on the list to be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

DMs not appearing when contact list is too large

3 participants