Why Nostr? What is Njump?
2024-10-26 14:33:23

Anthony Accioly on Nostr: Hi greenart7c3, I’m sorry to bother you, but I’ve just confirmed that Citrine is ...

Hi , I’m sorry to bother you, but I’ve just confirmed that Citrine is also experiencing the “store more than one replaceable event per kind and pubkey” issue as described by below.
ohhh I just logged into your relay and it sent ALL the past versions of your own 10002 events. There are 44 10002 events coming down to Amethyst just for yourself. For each one of the 43 outdated events, Amethyst replies with the new one.

something is wrong with haven's replaceable code. A filter by kind 10002 should only return the latest event, not all versions.

You can test it here: https://lightningk0ala.github.io/nostr-wtf/query

with filter: [{"kinds": [10002]}]

I have the delete events option enabled, but Citrine is still returning more than one kind 10002 event for my pubkey.



Since folks may not want to open Citrine to the internet, I wrote a quick script with `nostr-tools` (sorry, I’m not a JavaScript person at all) to reproduce the problem below. Just replace the IP address and pubkey. My local Citrine instance is currently storing and returning several different kind 10002 events for my pubkey.

```javascript
import WebSocket from 'ws'
import { Relay, useWebSocketImplementation } from 'nostr-tools/relay'

useWebSocketImplementation(WebSocket);

const relay = await Relay.connect('ws://192.168.1.1:4869');
console.log(`connected to ${relay.url}`)

const pk = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"

let eventCount = 0

relay.subscribe([
{
kinds: [10002],
authors: [pk],
},
], {
onevent(event) {
console.log('got event:', event)
eventCount++
},
oneose() {
console.log('Got', eventCount, 'events')
relay.close()
}
})
```

Could you please have a look when you have a chance?
and are also currently working on fixing this in HAVEN + katru.

#devstr
Author Public Key
npub1a6we08n7zsv2na689whc9hykpq4q6sj3kaauk9c2dm8vj0adlajq7w0tyc