Commit Graph

28 Commits

Author SHA1 Message Date
William Casarin
e3642b92d1 txn: fix subtle transaction inheritence bugs
This fixes subtle bugs with transaction inheritence. Since we were not
passing the inherited state to moved value, we were sometimes committing
transactions more than once.

Changelog-Fixed: Fix many nostrdb transaction related crashes
2024-01-26 14:03:49 -08:00
William Casarin
bfad2ab42d ndb/txn: make transactions failable
Since there may be situations where we close and re-open the database,
we need to make sure transactions fail when the database is not open.

Make NdbTxn an init?() constructor and check for ndb.closed. If it's
closed, then fail transaction construction.

This fixes crashes during high database activity when switching from
background to foreground and vice-versa.

Fixes: da2bdad18d ("nostrdb: close database when backgrounded")
2024-01-10 14:27:02 -08:00
William Casarin
76508dbbfd perf: don't continuously attempt to fetch old profiles
Changelog-Changed: Save bandwidth by only fetching new profiles after a certain amount of time
2023-10-24 13:02:41 +08:00
William Casarin
7a85ae29ca search: switch to nostrdb profile searching
Changelog-Changed: Switch to nostrdb for @'s and user search
2023-09-21 13:19:22 -04:00
William Casarin
fc9b9f2940 ndb: switch profile queries to use transactions
this should ensure no crashing occurs when querying profiles
2023-09-21 09:10:06 -04:00
William Casarin
bb4fd75576 nostrdb: add profiles to nostrdb
This adds profiles to nostrdb

- Remove in-memory Profiles caches, nostrdb is as fast as an in-memory cache
- Remove ProfileDatabase and just use nostrdb directly

Changelog-Changed: Use nostrdb for profiles
2023-09-21 09:10:06 -04:00
William Casarin
0338297bfe Live Music & Generic Statuses
Changelog-Added: Added live music statuses
Changelog-Added: Added generic user statuses
2023-08-23 13:26:55 -07:00
William Casarin
2b99f94d13 profiledb: disable database lookups for now
This is causing extremely bad lag in the UI
2023-07-31 05:38:19 -07:00
William Casarin
7040235605 refactor: add Pubkey, Privkey, NoteId string aliases
This is a non-behavioral change in preparation for the actual switchover
from Strings to Ids. The purpose of this kit is to reduce the size of
the switchover commit which is going to be very large.
2023-07-31 05:38:19 -07:00
William Casarin
160b293359 performance: don't spam nip05 validation on startup
Since we don't show these on events anymore, we don't need to spam nip05
validation. We can just check when we go to the profile page

Changelog-Fixed: Eliminate nostr address validation bandwidth on startup
2023-07-17 13:25:56 -07:00
640fbf23ea Fix UI bug with user search and fix race conditions on profiles NIP-05 cache
Signed-off-by: Terry Yiu <git@tyiu.xyz>
Reviewed-by: William Casarin <jb55@jb55.com>
Signed-off-by: William Casarin <jb55@jb55.com>
2023-07-04 09:09:14 -07:00
6e964f71ff Add trie-based user search cache to replace non-performant linear scans
Changelog-Added: Speed up user search
Tested-by: William Casarin <jb55@jb55.com>
Fixes: #1219
Closes: #1342
2023-07-03 12:06:01 -07:00
Bryan Montz
ea73c5252d Merge branch 'master' into user-cache 2023-05-26 06:46:47 -05:00
Bryan Montz
61ff7da2ae make database write async at the call site and update tests 2023-05-25 09:09:50 -05:00
Bryan Montz
7259641e26 speed optimizations: cache network_pull_date in memory and ensure writes on background queue 2023-05-25 08:20:41 -05:00
William Casarin
bffa42a13a Supporter Badges 2023-05-15 11:57:37 -07:00
Bryan Montz
d58a1e0ba3 add ability to check the freshness of a PersistedProfile 2023-05-15 08:31:49 -05:00
Bryan Montz
3b0bb48dd4 integrate ProfileDatabase with existing Profiles caching class 2023-05-12 07:21:59 -05:00
William Casarin
bb32d72903 nwc: clear the zapper cache for our pubkey when we attach a new wallet 2023-05-10 14:07:24 -07:00
Bryan Montz
ce599badee fix crash related to preloading events
Changelog-Fixed: fix crash related to preloading events
2023-05-09 23:39:41 -05:00
William Casarin
0a4e75bfec Add nip05 search
Changelog-Added: Added ability to lookup users by nip05 identifiers
2023-03-29 19:24:06 -04:00
William Casarin
006f8d79e0 Lightning Zaps
Added initial lightning zaps/tipping integration

Changelog-Added: Receive Lightning Zaps
2023-02-02 15:51:57 -08:00
William Casarin
8785f31834 NIP05 Verification
Changelog-Added: Added NIP05 Verification
2023-01-04 01:30:37 -08:00
William Casarin
82b7cab9b1 remove unused combine reference
Signed-off-by: William Casarin <jb55@jb55.com>
2022-07-28 13:11:58 -07:00
William Casarin
6ac4214be7 insert sort, profile updates revamp
Signed-off-by: William Casarin <jb55@jb55.com>
2022-05-09 10:33:03 -07:00
William Casarin
0eb1372937 more mention progress
Signed-off-by: William Casarin <jb55@jb55.com>
2022-05-07 13:50:19 -07:00
William Casarin
4704431c74 image cache
Signed-off-by: William Casarin <jb55@jb55.com>
2022-05-04 18:49:40 -07:00
William Casarin
b4660bd58f oops, add profiles
Signed-off-by: William Casarin <jb55@jb55.com>
2022-04-17 08:48:25 -07:00