From a787093c528a6c2727d90b98d44ff0b17ee77c33 Mon Sep 17 00:00:00 2001 From: Semisol Date: Thu, 26 May 2022 20:21:23 +0300 Subject: [PATCH 1/4] nip15: create draft --- 15.md | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 15.md diff --git a/15.md b/15.md new file mode 100644 index 0000000..9c7c341 --- /dev/null +++ b/15.md @@ -0,0 +1,34 @@ +NIP-15 +====== + +End of Stored Events Notice +--------------------------- + +`draft` `optional` `author:Semisol` + +Relays may support notifying clients when all stored events have been sent. + +If a client sets `eose_notice` field to `true` in any of the filters in a `REQ` message and the relay supports this NIP, the relay MUST send the client a `EOSE` message in the format `["EN", ]` which indicates that all stored events matching the filters specified have been sent and all events from on are newly published events. + +Example Subscription Filter +--------------------------- + +The following provides an example of a filter that requests the `set_metadata` (`0`) event(s) of a pubkey and requests the server to send an end of stored events message. + +``` +{ + "kinds": [0], + "authors": ["52b4a076bcbbbdc3a1aefa3735816cf74993b1b8db202b01c883c58be7fad8bd"], + "eose_notice": true +} +``` + +Client Behavior +--------------- + +Clients SHOULD use the `supported_nips` field to learn if a relay supports end of stored events notices. Clients MAY send filters with `eose_notice` to any relay, if they are prepared to not receive a message from relays that do not support this NIP. + +Motivation +---------- + +The motivation for this proposal is to reduce uncertainty when all events have been sent by a relay to make client code possibly less complex. From 3374869b3f447066ce8fae138be347788c8d8946 Mon Sep 17 00:00:00 2001 From: Semisol Date: Thu, 26 May 2022 20:26:34 +0300 Subject: [PATCH 2/4] nip15: fix draft artifact --- 15.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/15.md b/15.md index 9c7c341..3ae1ef7 100644 --- a/15.md +++ b/15.md @@ -8,7 +8,7 @@ End of Stored Events Notice Relays may support notifying clients when all stored events have been sent. -If a client sets `eose_notice` field to `true` in any of the filters in a `REQ` message and the relay supports this NIP, the relay MUST send the client a `EOSE` message in the format `["EN", ]` which indicates that all stored events matching the filters specified have been sent and all events from on are newly published events. +If a client sets `eose_notice` field to `true` in any of the filters in a `REQ` message and the relay supports this NIP, the relay MUST send the client a `EOSE` message in the format `["EOSE", ]` which indicates that all stored events matching the filters specified have been sent and all events from on are newly published events. Example Subscription Filter --------------------------- From f49f26fbe23372feb1e45d425d0f605e29d79809 Mon Sep 17 00:00:00 2001 From: Semisol <45574030+Semisol@users.noreply.github.com> Date: Fri, 27 May 2022 17:54:38 +0300 Subject: [PATCH 3/4] nip15: EOSE message will be sent always --- 15.md | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) diff --git a/15.md b/15.md index 3ae1ef7..c2a55b7 100644 --- a/15.md +++ b/15.md @@ -8,25 +8,12 @@ End of Stored Events Notice Relays may support notifying clients when all stored events have been sent. -If a client sets `eose_notice` field to `true` in any of the filters in a `REQ` message and the relay supports this NIP, the relay MUST send the client a `EOSE` message in the format `["EOSE", ]` which indicates that all stored events matching the filters specified have been sent and all events from on are newly published events. - -Example Subscription Filter ---------------------------- - -The following provides an example of a filter that requests the `set_metadata` (`0`) event(s) of a pubkey and requests the server to send an end of stored events message. - -``` -{ - "kinds": [0], - "authors": ["52b4a076bcbbbdc3a1aefa3735816cf74993b1b8db202b01c883c58be7fad8bd"], - "eose_notice": true -} -``` +If a relay supports this NIP, the relay SHOULD send the client a `EOSE` message in the format `["EOSE", ]` after it has sent all the events it has persisted and all the events that come after this message are newly published. Client Behavior --------------- -Clients SHOULD use the `supported_nips` field to learn if a relay supports end of stored events notices. Clients MAY send filters with `eose_notice` to any relay, if they are prepared to not receive a message from relays that do not support this NIP. +Clients SHOULD use the `supported_nips` field to learn if a relay supports end of stored events notices. Motivation ---------- From 12f6e9ee625ae2743e10dec16c7eec85e5a8f150 Mon Sep 17 00:00:00 2001 From: Semisol Date: Fri, 27 May 2022 19:43:15 +0300 Subject: [PATCH 4/4] nip15: clarify --- 15.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/15.md b/15.md index c2a55b7..2a1c039 100644 --- a/15.md +++ b/15.md @@ -8,7 +8,7 @@ End of Stored Events Notice Relays may support notifying clients when all stored events have been sent. -If a relay supports this NIP, the relay SHOULD send the client a `EOSE` message in the format `["EOSE", ]` after it has sent all the events it has persisted and all the events that come after this message are newly published. +If a relay supports this NIP, the relay SHOULD send the client a `EOSE` message in the format `["EOSE", ]` after it has sent all the events it has persisted and it indicates all the events that come after this message are newly published. Client Behavior ---------------