Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
578d473
Make RelayPool private to NostrNetworkManager and migrate usages
danieldaquino Aug 16, 2025
5f3ce30
Fix memory race condition
danieldaquino Aug 19, 2025
8083269
Switch to local relay model
danieldaquino Aug 19, 2025
abd797b
Fix another race condition that leads to a memory error
danieldaquino Aug 19, 2025
e113dee
Publish "loading" variable update on the main thread to avoid undefin…
danieldaquino Aug 20, 2025
940b83f
Add ndb subscription tests
danieldaquino Aug 22, 2025
76b6d5c
Update published items on the main actor
danieldaquino Aug 27, 2025
a5aff15
Improve task cancellation management in SubscriptionManager
danieldaquino Aug 27, 2025
9620dcf
Fix crash when loading all follows
danieldaquino Aug 27, 2025
ab6ea7a
Fix issue where repost and like counts would not appear
danieldaquino Aug 28, 2025
739a3a0
Add more test cases to SubscriptionManager tests
danieldaquino Aug 28, 2025
46c3667
Update setting on main actor to avoid crashes
danieldaquino Aug 28, 2025
c4c3656
Multi-session subscriptions and RelayPool reopening
danieldaquino Aug 28, 2025
809c8c8
Fix missing relay list from profile
danieldaquino Aug 29, 2025
9709e69
Fix forever loading Universe view
danieldaquino Aug 29, 2025
0f26d50
Prevent publishing changes to Observable outside the main thread
danieldaquino Aug 29, 2025
de70d19
Fix NIP-05 timeline crash
danieldaquino Sep 1, 2025
ab22206
Fix broken Follow Pack timeline
danieldaquino Sep 1, 2025
c43a37d
Fix forever-loading quote repost view
danieldaquino Sep 1, 2025
4478672
Fix occasional stale timeline issue
danieldaquino Sep 3, 2025
d766029
Improve loading UX in the home timeline
danieldaquino Sep 3, 2025
9fb7ed7
Fix race condition on app swap that would cause ndb to remain closed
danieldaquino Sep 3, 2025
2550d61
Fix test compilation issues
danieldaquino Sep 3, 2025
7eb759a
Fix issue with wallet loading
danieldaquino Sep 5, 2025
9bcee29
Fix forever-loading hashtag view
danieldaquino Sep 5, 2025
2bea2fa
Add load more content button to the top bar
danieldaquino Sep 6, 2025
3290e1f
Improve NostrNetworkManager interfaces
danieldaquino Sep 10, 2025
fcd8131
nostrdb: config: custom writer scratch size
jb55 Mar 19, 2025
6847019
nostrdb: Initial relay index implementation
jb55 Mar 19, 2025
a877a19
nostrdb: relay: add note relay iteration
jb55 Mar 20, 2025
5961bf7
nostrdb: ndb: add print-relay-kind-index-keys
jb55 Mar 20, 2025
c667419
nostrdb: win: fix build on windows
jb55 Mar 20, 2025
c29027f
nostrdb: note: always write relay index
jb55 Mar 21, 2025
f0521ba
nostrdb: relay-index: fix a few bugs
jb55 Mar 21, 2025
e42b14c
nostrdb: debug: add a print for debugging rust integration
jb55 Mar 21, 2025
a0b8512
nostrdb: relay: fix race condition bug
jb55 Mar 21, 2025
af2298d
nostrdb: relay: fix potential relay index corruption
jb55 Mar 21, 2025
0f66e87
nostrdb: Relay queries
jb55 Mar 22, 2025
c728210
nostrdb: query: implement author_kind query plan
jb55 Mar 23, 2025
9cff860
nostrdb: fix build on macos
jb55 Mar 24, 2025
0b8090c
nostrdb: query: implement profile search query plans
jb55 Mar 30, 2025
64c16e7
nostrdb: filter: add initial custom filtering logic
jb55 Apr 8, 2025
5c75e87
nostrdb: eq: fix fallthrough bug
jb55 Apr 9, 2025
3a37a6c
nostrdb: change <=10 author search queries to ==1
jb55 Apr 29, 2025
fa2d240
nostrdb: nostrdb: calculate id in ndb_note_verify
jb55 Jun 24, 2025
0847c53
nostrdb: add ndb_builder_push_tag_id
jb55 Jul 3, 2025
b5079c4
nostrdb: memory: fix a bunch of memory leaks
jb55 Jul 8, 2025
84839d1
nostrdb: mem: search cursor close
jb55 Jul 11, 2025
3420676
nostrdb: mem: reaction stats cleanup
jb55 Jul 11, 2025
4d8313c
nostrdb: mem: relay iter cleanup
jb55 Jul 11, 2025
8014d77
nostrdb: mem: builder clear before free
jb55 Jul 11, 2025
aa8ce31
nostrdb: mem: close cursors in print helpers
jb55 Jul 11, 2025
42a0f2c
nostrdb: Revert "mem: search cursor close"
jb55 Jul 11, 2025
66e10db
nostrdb: mem: re-enable profile freeing
jb55 Jul 11, 2025
387af19
nostrdb: win: fix heap corruption with flatbuf
jb55 Jul 11, 2025
a040a02
nostrdb: search: fix memleak in profile search
jb55 Jul 11, 2025
d565eb2
nostrdb: query: enforce author matches in author_kind queries
jb55 Jul 17, 2025
ecbfb37
Fix incompatibilities with new nostrdb version
danieldaquino Sep 10, 2025
1caad24
Add note provenance filter support to SubscriptionManager
danieldaquino Sep 11, 2025
2185984
Stream from both NDB and network relays
danieldaquino Sep 15, 2025
0582892
Improve Follow pack timeline loading logic in the Universe view
danieldaquino Sep 15, 2025
8164eee
Return network EOSE in normal mode if device is offline
danieldaquino Sep 15, 2025
de528f3
Improve loading speed on home timeline
danieldaquino Sep 17, 2025
a3ef361
Fix OS 26 build errors
danieldaquino Sep 18, 2025
a09e22d
Improve streaming interfaces and profile loading logic
danieldaquino Sep 19, 2025
798f9ec
Improve loading speeds for home timeline and universe view
danieldaquino Sep 21, 2025
eda4212
Disable refreshable on Universe view
danieldaquino Sep 24, 2025
e55675a
Optimize HomeModel subscription usage
danieldaquino Sep 24, 2025
fe491bf
Increase MAX_CONCURRENT_SUBSCRIPTION_LIMIT
danieldaquino Sep 25, 2025
9153a91
Cancel timeout task on stream cancellation
danieldaquino Sep 25, 2025
258d087
Check if Ndb is closed before running subscribe and query operations
danieldaquino Sep 26, 2025
fe62aea
Stop ProfileManager when app is being backgrounded
danieldaquino Sep 26, 2025
1b5f107
Add more safeguards to prevent RUNNINGBOARD 0xdead10cc crashes
danieldaquino Sep 29, 2025
32e8c1b
Improve logging in SubscriptionManager
danieldaquino Oct 1, 2025
84c4594
Fix timeline staleness
danieldaquino Oct 1, 2025
667a228
Ensure to publish object changes on the main thread
danieldaquino Oct 3, 2025
3437cf5
Further improvements to app lifecycle handling
danieldaquino Oct 5, 2025
d9306d4
Modify NostrNetworkManager pipeline architecture
danieldaquino Oct 5, 2025
61eb833
Add temporary experimental delay to check hypothesis on occasional in…
danieldaquino Oct 5, 2025
01ec05a
Fix test build error
danieldaquino Oct 6, 2025
7691b48
Fix testDecodingPayInvoiceRequest test failure
danieldaquino Oct 6, 2025
4f479d0
Fix RelayPool connection race condition without time delays
danieldaquino Oct 6, 2025
588ef46
Hide "Load new content" behind feature flag
danieldaquino Oct 8, 2025
9311a76
Speed up quote reposts view loading
danieldaquino Oct 8, 2025
c80d4f1
Unpublish incoming notes to prevent unnecessary redraws
danieldaquino Oct 8, 2025
70d0d9d
Offload note filtering computations from the view body render function
danieldaquino Oct 8, 2025
05c02f7
Initialize AVPlayerItem on the background to avoid hitches
danieldaquino Oct 8, 2025
7c15941
Perform LNURL computation on the background in EventActionBar
danieldaquino Oct 9, 2025
991a4a8
Move most of RelayPool away from the Main Thread
danieldaquino Oct 10, 2025
ab2c162
Fix test compilation issues
danieldaquino Oct 13, 2025
690f8b8
Implement timestamp-based network subscription optimization
danieldaquino Oct 13, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 31 additions & 31 deletions DamusNotificationService/NotificationService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -67,40 +67,40 @@ class NotificationService: UNNotificationServiceExtension {
nip05: profile?.nip05)
}()
let sender_pubkey = nostr_event.pubkey

Task {

// Don't show notification details that match mute list.
// TODO: Remove this code block once we get notification suppression entitlement from Apple. It will be covered by the `guard should_display_notification` block
if state.mutelist_manager.is_event_muted(nostr_event) {
// We cannot really suppress muted notifications until we have the notification supression entitlement.
// The best we can do if we ever get those muted notifications (which we generally won't due to server-side processing) is to obscure the details
let content = UNMutableNotificationContent()
content.title = NSLocalizedString("Muted event", comment: "Title for a push notification which has been muted")
content.body = NSLocalizedString("This is an event that has been muted according to your mute list rules. We cannot suppress this notification, but we obscured the details to respect your preferences", comment: "Description for a push notification which has been muted, and explanation that we cannot suppress it")
content.sound = UNNotificationSound.default
contentHandler(content)
return
}

guard should_display_notification(state: state, event: nostr_event, mode: .push) else {
Log.debug("should_display_notification failed", for: .push_notifications)
// We should not display notification for this event. Suppress notification.
// contentHandler(UNNotificationContent())
// TODO: We cannot really suppress until we have the notification supression entitlement. Show the raw notification
contentHandler(request.content)
return
}

guard let notification_object = generate_local_notification_object(ndb: state.ndb, from: nostr_event, state: state) else {
Log.debug("generate_local_notification_object failed", for: .push_notifications)
// We could not process this notification. Probably an unsupported nostr event kind. Suppress.
// contentHandler(UNNotificationContent())
// TODO: We cannot really suppress until we have the notification supression entitlement. Show the raw notification
contentHandler(request.content)
return
}
// Don't show notification details that match mute list.
// TODO: Remove this code block once we get notification suppression entitlement from Apple. It will be covered by the `guard should_display_notification` block
if await state.mutelist_manager.is_event_muted(nostr_event) {
// We cannot really suppress muted notifications until we have the notification supression entitlement.
// The best we can do if we ever get those muted notifications (which we generally won't due to server-side processing) is to obscure the details
let content = UNMutableNotificationContent()
content.title = NSLocalizedString("Muted event", comment: "Title for a push notification which has been muted")
content.body = NSLocalizedString("This is an event that has been muted according to your mute list rules. We cannot suppress this notification, but we obscured the details to respect your preferences", comment: "Description for a push notification which has been muted, and explanation that we cannot suppress it")
content.sound = UNNotificationSound.default
contentHandler(content)
return
}

guard await should_display_notification(state: state, event: nostr_event, mode: .push) else {
Log.debug("should_display_notification failed", for: .push_notifications)
// We should not display notification for this event. Suppress notification.
// contentHandler(UNNotificationContent())
// TODO: We cannot really suppress until we have the notification supression entitlement. Show the raw notification
contentHandler(request.content)
return
}

Task {
guard let notification_object = generate_local_notification_object(ndb: state.ndb, from: nostr_event, state: state) else {
Log.debug("generate_local_notification_object failed", for: .push_notifications)
// We could not process this notification. Probably an unsupported nostr event kind. Suppress.
// contentHandler(UNNotificationContent())
// TODO: We cannot really suppress until we have the notification supression entitlement. Show the raw notification
contentHandler(request.content)
return
}

let sender_dn = DisplayName(name: sender_profile.name, display_name: sender_profile.display_name, pubkey: sender_pubkey)
guard let (improvedContent, _) = await NotificationFormatter.shared.format_message(displayName: sender_dn.displayName, notify: notification_object, state: state) else {

Expand Down
Loading