From d48b1f7c33593d7a1d0758477d2e288df2383533 Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Thu, 4 Jun 2026 10:10:54 -0300 Subject: [PATCH] sdk: replace replaceables instead of saving. --- sdk/list.go | 2 +- sdk/metadata.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/list.go b/sdk/list.go index 084f489..8f1028d 100644 --- a/sdk/list.go +++ b/sdk/list.go @@ -94,7 +94,7 @@ func fetchGenericList[V comparable, I TagItemWithValue[V]]( // we'll only save this if we got something which means we found at least one event lastFetchKey := makeLastFetchKey(actualKind, pubkey) sys.KVStore.Set(lastFetchKey, encodeTimestamp(nostr.Now())) - sys.Store.SaveEvent(*v.Event) + sys.Store.ReplaceEvent(*v.Event) } // save cache even if we didn't get anything diff --git a/sdk/metadata.go b/sdk/metadata.go index f5956a2..4fd21bf 100644 --- a/sdk/metadata.go +++ b/sdk/metadata.go @@ -142,7 +142,7 @@ func (sys *System) FetchProfileMetadata(ctx context.Context, pubkey nostr.PubKey if newM := sys.tryFetchMetadataFromNetwork(ctx, pubkey); newM != nil { pm = *newM - sys.Store.SaveEvent(*pm.Event) + sys.Store.ReplaceEvent(*pm.Event) // we'll only save this if we got something which means we found at least one event lastFetchKey := makeLastFetchKey(0, pubkey)