ndb: switch profile queries to use transactions

this should ensure no crashing occurs when querying profiles
This commit is contained in:
William Casarin
2023-09-10 14:51:55 -07:00
parent 622a436589
commit fc9b9f2940
51 changed files with 435 additions and 252 deletions

View File

@@ -24,10 +24,11 @@ struct ReplyView: View {
var ReplyingToSection: some View {
HStack {
Group {
let txn = NdbTxn(ndb: damus.ndb)
let names = references
.map { pubkey in
let pk = pubkey
let prof = damus.profiles.lookup(id: pk)
let prof = damus.ndb.lookup_profile_with_txn(pk, txn: txn)?.profile
return "@" + Profile.displayName(profile: prof, pubkey: pk).username.truncate(maxLength: 50)
}
.joined(separator: " ")