Commit Graph

4441 Commits

Author SHA1 Message Date
Daniel D’Aquino
48d3049f3f Improve accessibility and localization support on Damus Labs screen
Note: This is an improvement on an unreleased feature, so no changelog
entry is needed.

Changelog-None
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
2025-11-17 17:42:06 -08:00
Daniel D’Aquino
529bb0dca0 Add more toggles in Labs
No changelog is needed because we already have changelog messages for
the features added.

Changelog-None
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
2025-11-17 17:42:06 -08:00
Daniel D’Aquino
0879fa39dc Temporarily disable zaps
Changelog-Removed: Temporarily disabled note zaps
Closes: https://github.com/damus-io/damus/issues/3314
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
2025-11-17 17:42:06 -08:00
ericholguin
b8c664d354 Damus Live
This PR adds Live Streaming and Live Chat to Damus via Damus Labs.

Changelog-Added: Added live stream timeline
Changelog-Added: Added live chat timeline
Changelog-Added: Added ability to create live chat event
Changelog-Added: Damus Labs Toggle

Signed-off-by: ericholguin <ericholguin@apache.org>
2025-11-14 15:36:43 -08:00
Daniel D’Aquino
a31f6bce0e Fix foreground crash caused by a race condition on ProfileModel
`seen_event` set was not isolated, which lead to occasional race
conditions between different actors accessing it simultaneously, leading
to crashes.

Closes: https://github.com/damus-io/damus/issues/3311
Changelog-Fixed: Fixed an occasional random crash related to viewing profiles
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
2025-11-06 10:34:43 -08:00
Daniel D’Aquino
58f4988237 Avoid note subscription clipping in HomeModel
This commit adds a new event subscription task in HomeModel, one which
streams low volume but important filters from NostrDB.

This was done to address an issue where the contact filters in the
general handler task could yield too many notes from NostrDB, hitting
its limits and clipping off important events such as mute-lists, leading
to downstream issues such as unintended mute-list overrides.

This issue was not present since the last public release, therefore no
changelog entry is needed.

Changelog-None
Closes: https://github.com/damus-io/damus/issues/3256
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
2025-11-06 10:29:17 -08:00
Daniel D’Aquino
bd1eae5f26 Add more contribution guidelines
Changelog-None
Closes: https://github.com/damus-io/damus/issues/3301
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
2025-11-06 10:27:16 -08:00
Daniel D’Aquino
5380918b15 Bump up the version to 1.16
Closes: https://github.com/damus-io/damus/issues/3085
Changelog-None
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
2025-11-05 15:04:35 -08:00
Daniel D’Aquino
1015b1cb08 1.15 changelog
Changelog-None
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
2025-11-05 14:58:07 -08:00
Daniel D’Aquino
9ca6b5e9ab Hide the Favourites feature behind a feature flag
Some issues were encountered with this feature. Disabling it for now.

Once we have the full Damus Labs UI, we will add the feature there.

Changelog-Changed: Placed the Favorites feature behind a feature flag
Closes: https://github.com/damus-io/damus/issues/3304
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
2025-10-31 15:09:46 -07:00
Daniel D’Aquino
56a7d1ed78 Merge pull request #3204 from damus-io/local-relay-model
This integrates all the local relay model work done in PR #3204.

Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
2025-10-31 13:23:04 -07:00
Daniel D’Aquino
01150155ab Add missing ProfileObserver to EventProfileName view
It was noticed that occasionally the profile name at the event view
would not load to the user's display name.

The issue was fixed by adding a missing profile observer.

Issue introduced after our last public release, no need for changelog
entries.

Changelog-None
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
2025-10-31 10:43:33 -07:00
Daniel D’Aquino
a8202d89f8 Remove unnecessary wait in note rendering
Previously, the note content rendering logic would wait for the note
and its blocks to be available in NostrDB before displaying the parsed
version of the note to the user.

However, it is now possible to parse those on demand, and there are code
paths to ensure that it will do so if those parsed blocks are not
readily available from NostrDB.

Therefore, the wait is not necessary, and removing it fixes the delay we
have been experiencing.

The issue was likely introduced after the last public release, so no
changelog item is needed

Changelog-None
Closes: https://github.com/damus-io/damus/issues/3296
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
2025-10-31 10:33:40 -07:00
Daniel D’Aquino
d4402b0afc Merge branch 'master' into local-relay-model
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
2025-10-29 16:43:09 -07:00
ericholguin
036afbf5b8 fix: Don't show onboarding when logged in with npub
This PR makes sure to not show the onboarding screens
when a user is logged in with an npub as it doesn't
make sense for them to see that.

Changelog-Fixes: Fixes issue where onboarding views are shown to npub users

Signed-off-by: ericholguin <ericholguin@apache.org>
2025-10-29 12:14:34 -07:00
Daniel D’Aquino
7ba2ec6713 Add Damus Labs fast-track review process to PR templates
Closes: https://github.com/damus-io/damus/issues/3271
Changelog-None
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
2025-10-27 17:11:07 -07:00
ericholguin
36b40f53af Damus Labs
This PR adds the new Damus Labs view.
This will allow us to make the new things we work on more prominent.
Any new features we want to iterate fast on and get to our users a lot faster
are perfect for Damus Labs. This will be exclusive to Damus Purple Subscribers.

Changelog-Added: Added Damus Labs

Signed-off-by: ericholguin <ericholguin@apache.org>
2025-10-26 15:07:39 -07:00
Daniel D’Aquino
58e6a49bcf Fix race condition leading to intermittent issues with ndb streaming and related tests
A race condition was identified where notes would get dropped if they
get indexed in the time window between when a query is made and the subscription is made.

The issue was fixed by making the subscribe call before making the query
call, to ensure we get all notes from that time when we perform the
query.

This dropped the failure rate for ndb subscription tests from about 20%
down to about 4%.

Local relay model issue was not publicly released, which is why the
changelog entry is "none".

Changelog-None
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
2025-10-24 18:40:32 -07:00
Daniel D’Aquino
7cf9a07099 Add more automated tests around ndb streaming
Changelog-None
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
2025-10-24 17:15:04 -07:00
Daniel D’Aquino
7afcaa99fe Reduce race condition probability in Ndb streaming functions
This attempts to reduce race conditions coming from Ndb streaming
functions that could lead to lost notes or crashes.

It does so by making two improvements:
1. Instead of callbacks, now the callback handler uses async streams,
   which reduces the chances of a callback being called before the last
   item was processed by the consumer.
2. The callback handler will now queue up received notes if there are
   no listeners yet. This is helpful because we need to issue the
   subscribe call to nostrdb before getting the subscription id and
   setting up a listener, but in between that time nostrdb may still
   send notes which would effectively get dropped without this queuing
   mechanism.

Changelog-Fixed: Improved robustness in the part of the code that streams notes from nostrdb
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
2025-10-24 16:25:44 -07:00
Daniel D’Aquino
10b4d804f8 Shift since optimization filter by two minutes
Changelog-Changed: Tweaked since optimization filter to capture notes that would otherwise be lost
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
2025-10-24 14:30:58 -07:00
Daniel D’Aquino
e3d27ae472 Turn off network optimization for ProfilesManager
This may negatively impact performance, but improves accuracy and
prevents profile loading issues

Changelog-None
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
2025-10-24 14:27:06 -07:00
Daniel D’Aquino
02296d7752 Configure UI to be in compatibility mode
This temporarily addresses iOS 26 UI issues by setting a UI
configuration called "compatibility mode" until we implement full iOS 26
support.

See https://developer.apple.com/documentation/BundleResources/Information-Property-List/UIDesignRequiresCompatibility

Furthermore, it addresses one remaining UI issue with the timeline top
padding by altering the padding calculation for iOS 26 targets.

Changelog-None
Closes: https://github.com/damus-io/damus/issues/3283
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
2025-10-22 17:48:44 -07:00
Daniel D’Aquino
9dfd338077 Fix hang on sign-up
This fixes a hang during sign-up, which was caused by a change in
RelayPool handling code that would only send data to handlers with
matching subscription IDs.

It so happens that some handlers want to receive all notes, and they set
the filters to `nil` to achieve that.

Furthermore, some sign-up networking code was moved to prevent race conditions.

No changelog entry because the behaviour was not changed since the last
public release.

Changelog-None
Closes: https://github.com/damus-io/damus/issues/3254
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
2025-10-22 14:50:11 -07:00
Daniel D’Aquino
fe09f9da99 Add signup UI end to end test
Changelog-None
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
2025-10-22 14:25:38 -07:00
Daniel D’Aquino
67d2b249b6 Merge branch 'master' into local-relay-model
Logical merge errors fixed manually

Changelog-None
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
2025-10-22 11:56:58 -07:00
Daniel D’Aquino
9555145359 Fix automated test issues
Closes: https://github.com/damus-io/damus/issues/3275
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
2025-10-20 17:35:23 -07:00
Daniel D’Aquino
8122a8a580 Revert "Removes notifications from muted npubs"
This reverts commit 6605c5e583.
2025-10-15 14:41:20 -07:00
Daniel D’Aquino
690f8b891e Implement timestamp-based network subscription optimization
Changelog-Changed: Optimized network bandwidth usage and improved timeline performance
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
2025-10-15 14:15:55 -07:00
Daniel D’Aquino
91426a79b9 Add performance profiling requirement to PRs
Changelog-None
Closes: https://github.com/damus-io/damus/issues/3247
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
2025-10-15 09:30:03 -07:00
Askia Linder
61f695b7c6 Add Timeline switcher button in PostingTimelineView. Switch between your following or NIP-81 favorites. User can favorite a user via ProfileActionSheetView or ProfileView.
Closes: https://github.com/damus-io/damus/issues/2438
Changelog-Added: Add Timeline switcher button for NIP-81-favorites
Signed-off-by: Askeew <askeew@hotmail.com>
2025-10-15 09:13:37 -07:00
alltheseas
6605c5e583 Removes notifications from muted npubs 2025-10-15 00:03:20 -05:00
Daniel D’Aquino
ab2c16288b Fix test compilation issues
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
2025-10-13 15:16:54 -07:00
Daniel D’Aquino
991a4a86e6 Move most of RelayPool away from the Main Thread
This is a large refactor that aims to improve performance by offloading
RelayPool computations into a separate actor outside the main thread.

This should reduce congestion on the main thread and thus improve UI
performance.

Also, the internal subscription callback mechanism was changed to use
AsyncStreams to prevent race conditions newly found in that area of the
code.

Changelog-Fixed: Added performance improvements to timeline scrolling
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
2025-10-10 16:38:48 -07:00
Daniel D’Aquino
7c1594107f Perform LNURL computation on the background in EventActionBar
This is to reduce the amount of computation it takes to create the
EventActionBar view

Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
2025-10-08 17:23:59 -07:00
Daniel D’Aquino
05c02f7dc4 Initialize AVPlayerItem on the background to avoid hitches
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
2025-10-08 15:51:59 -07:00
Daniel D’Aquino
70d0d9dacf Offload note filtering computations from the view body render function
This attempts to improve the performance of InnerTimelineView by
performing event filtering computations on "EventHolder.insert" instead
of on each view body re-render, to improve SwiftUI performance.

Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
2025-10-08 15:10:47 -07:00
Daniel D’Aquino
c80d4f146c Unpublish incoming notes to prevent unnecessary redraws
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
2025-10-08 13:21:25 -07:00
Daniel D’Aquino
9311a767c8 Speed up quote reposts view loading
Closes: https://github.com/damus-io/damus/issues/3252
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
2025-10-08 10:39:51 -07:00
Daniel D’Aquino
588ef46402 Hide "Load new content" behind feature flag
This feature is not production-ready, and is not essential for the
current scope of work, so descoping it and hiding it behind a feature
flag until it is ready.

Changelog-Removed: Removed "Load new content" button
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
2025-10-08 10:20:10 -07:00
Daniel D’Aquino
4f479d0280 Fix RelayPool connection race condition without time delays
This improves upon a temporary fix we had for the RelayPool race
condition that would cause timeline staleness.

The root cause was that during app launch, the HomeModel would subscribe
to some filters, and the subscribe function would filter out any relays
not yet connected to avoid unnecessary waiting for EOSEs from disconnected relays.
However, that filtering would cause the subscribe request to not be
queued up or sent back to the relays once connected, causing the relays
to never receive those subscription requests and causing timeline
staleness.

This was fixed by separating the relay list used for the subcription
request from the relay list used for waiting for network EOSEs. This
allows other mechanisms to ensure the subscription will go through even
when the app is initializing and relays are not yet fully connected.

Fixes: 61eb833239
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
2025-10-06 15:19:05 -07:00
Daniel D’Aquino
7691b48fb6 Fix testDecodingPayInvoiceRequest test failure
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
2025-10-06 11:48:58 -07:00
Daniel D’Aquino
01ec05ab32 Fix test build error
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
2025-10-06 11:33:45 -07:00
Daniel D’Aquino
61eb833239 Add temporary experimental delay to check hypothesis on occasional init timeline staleness
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
2025-10-05 16:52:56 -07:00
Daniel D’Aquino
d9306d4153 Modify NostrNetworkManager pipeline architecture
Previously, we combined the ndb and network stream within a "session
subscription" stream, which was teared down and rebuilt every time the
app went into the background and back to the foreground (This was done to
prevent crashes related to access to Ndb memory when Ndb is closed).

However, this caused complications and instability on the network
stream, leading to timeline staleness.

To address this, the pipeline was modified to merge the ndb and network
streams further upstream, on the multi-session stage, allowing the
session subscription streams to be completely split between Ndb and the
network.

For the ndb stream, we still tear it down and bring it up along the app
foreground state, to prevent memory crashes. However, the network stream
is kept intact between sessions, since RelayPool will now automatically
handle resubscription on websocket reconnection. This prevents
complexity and potential race conditions that could lead to timeline
staleness.

Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
2025-10-05 15:28:16 -07:00
Daniel D’Aquino
3437cf5347 Further improvements to app lifecycle handling
- Resend subscription requests to relays when websocket connection is
  re-established
- More safeguard checks on whether Ndb is opened before accessing its
  memory
- Cancel queued unsubscribe requests on app backgrounding to avoid race
  conditions with subscribe requests when app enters the foreground
- Call Ndb re-open when Damus is active (not only on active notify), as
  experimentally there have been instances where active notify code has
  not been run. The operation is idempotent, so there should be no risk
  of it being called twice.

Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
2025-10-05 13:18:59 -07:00
Daniel D’Aquino
667a228e1a Ensure to publish object changes on the main thread
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
2025-10-03 10:29:26 -07:00
Daniel D’Aquino
84c4594d30 Fix timeline staleness
Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
2025-10-03 10:14:32 -07:00
Daniel D’Aquino
32e8c1b6e1 Improve logging in SubscriptionManager
Use Apple's unified logging system, and specify proper privacy levels
for each piece of information.

Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
2025-10-01 11:18:15 -07:00
Daniel D’Aquino
1b5f107ac6 Add more safeguards to prevent RUNNINGBOARD 0xdead10cc crashes
This commit adds more safeguards to prevent RUNNINGBOARD 0xdead10cc
crashes, by:
1. Using the `beginBackgroundTask(withName:expirationHandler:)` to
   request additional background execution time before completely
   suspending the app. See https://developer.apple.com/documentation/xcode/sigkill
2. Reorganizing app closing/cleanup tasks to be done in parallel when
   possible to decrease time needed to cleanup resources.

Signed-off-by: Daniel D’Aquino <daniel@daquino.me>
2025-09-29 16:39:14 -07:00