Hubmakerlabs / replicatr

Nostr relay with Internet Computer integration for inter-relay synchronization
https://mleku.dev/git/replicatr
GNU General Public License v2.0
13 stars 1 forks source link

revise replaceable events handling #17

Closed mleku closed 6 months ago

mleku commented 6 months ago

by accident due to the debugging process for the race conditions in the relay interface and eventstore for replaceable events code that used to find and delete it has been commented out, as this extra step often triggered a race condition

a simple test shows that a kind 0 event being updated currently now adds the event but the order of the results and the number that come back from a query without a limit set is undefined behaviour

in order to make this work as clients expect while exposing the ability to return the history of replaceable events, as most replaceable events are intended to be one per pubkey, the following changes are needed:

mleku commented 6 months ago

keeping issue open until we get clarification on draft NIP-66 but the rest is done, merging into main

mleku commented 6 months ago

nip-66 is being released tomorrow, hopefully this will happen tomorrow

adding descending timestamp sort order by default on results, newest first