nips icon indicating copy to clipboard operation
nips copied to clipboard

Generic Draft Event

Open vitorpamplona opened this issue 1 year ago • 9 comments

Adds a private draft event kind for any other event type. Clients can search by supported kinds via the k tag

Read here

vitorpamplona avatar Mar 14 '24 12:03 vitorpamplona

It may be useful to require an one-letter tag set to an event id/address when it is a comment/reply/referrer draft or empty string when "root" draft, like ['r', '<referenced-event-id-or-address-or-empty-string>']. Then one can fetch the draft of a reply to a specifc note or fetch a root draft.

arthurfranca avatar Mar 14 '24 17:03 arthurfranca

Good point, I have added anchor events. I don't think we can ask to have empty rs because this kind should work for non-kind1 events as well.

vitorpamplona avatar Mar 14 '24 18:03 vitorpamplona

I almost like this, but the e/a tags make me think that this should probably not be generic; drafts should be specified by kind number on a case-by-case basis, since you may want to search for something other than the anchor.

staab avatar Mar 14 '24 19:03 staab

I almost like this, but the e/a tags make me think that this should probably not be generic; drafts should be specified by kind number on a case-by-case basis, since you may want to search for something other than the anchor.

People can add other tags to this event at will. These are just the basic ones. The k already filters out things a client can't parse anyway.

vitorpamplona avatar Mar 14 '24 20:03 vitorpamplona

@mikedilger curious to hear your feedback from the Private Relay list section here. The idea is to have a list of relays to store events that only the author should see. A private outbox if you will.

vitorpamplona avatar May 30 '24 19:05 vitorpamplona

I haven't looked too deeply yet. But I have a lot of these kind 31234 events being submitted to my relay. I wonder if it's creating an event for ever letter people type. :joy:

Screenshot from 2024-06-22 10-23-45

alexgleason avatar Jun 22 '24 15:06 alexgleason

I wonder if it's creating an event for ever letter people type

It is. The goal for this event is to be saving drafts as people type so that if apps crash they never lose anything. Amethyst sends a new version in 1 second after the user stops typing if there is a change to the event.

Maybe this is the first real use of replaceables we have seen in Nostr.

vitorpamplona avatar Jun 22 '24 15:06 vitorpamplona

@vitorpamplona I've been having problems with uptime. I haven't been able to narrow it down yet, but I imagine this draft event isn't helping.

image

I get huge bursts of draft events, presumably when people on Amethyst are typing:

image

Is it really sending on every keystroke? It's not even debounced? That seems like a performance problem for both relays and users of Amethyst. It would make more sense to wait 5 seconds until the user has stopped typing to publish the draft event to other relays.

alexgleason avatar Jun 24 '24 01:06 alexgleason

It is denounced at every second. What's the chart saying? How many events are in that peak? I can't quite figure it out.

And what's the green line?

vitorpamplona avatar Jun 24 '24 02:06 vitorpamplona

fyi: I also see a lot of those events in our NWC only rely (we reject those events)

bumi avatar Jul 30 '24 22:07 bumi