Normalize relay urls before putting them in the database

This commit is contained in:
Jon Staab
2024-10-03 12:20:34 -07:00
parent 78c8c9e501
commit 63761c91c8
5 changed files with 29 additions and 16 deletions
+6 -1
View File
@@ -41,7 +41,12 @@ thunkWorker.addGlobalHandler(async ({event, relays, resolve}: ThunkWithResolve)
const pub = publish({event: signedEvent, relays})
// Copy the signature over since we had deferred it
;(repository.getEvent(signedEvent.id) as SignedEvent).sig = signedEvent.sig
const savedEvent = repository.getEvent(signedEvent.id) as SignedEvent
// The event may already be replaced or deleted
if (savedEvent) {
savedEvent.sig = signedEvent.sig
}
// Track publish success
const {id} = event