Accepting a deletion event that attempts to delete someone else's eve… #13

Closed
hoytech wants to merge 1 commit from master into master
hoytech commented 2026-03-05 04:53:51 +13:00 (Migrated from github.com)

…nt is not necessarily a failure. Update the test to verify the important property, which is that the event is not actually deleted.

…nt is not necessarily a failure. Update the test to verify the important property, which is that the event is not actually deleted.
hoytech commented 2026-03-05 05:00:26 +13:00 (Migrated from github.com)

Hi! In strfry I'm adding support for deletion of PREs using a-tag references, and I thought I'd use relay-tester to double-check the implementation.

All good, except I noticed strfry is failing 1 test, the "Accepted deletion of someone else's event".

IMO the test is too strict. The test posts an event from user 1, and then has user 2 attempt to delete this using a kind 5 e-tag. It verifies the relay rejects this event. However, strfry does not reject this event, even though it theoretically could. It is careful to ensure that the event is not actually deleted though, of course.

In the general case, a relay can't know that a referenced event is from another user, since it may not yet have seen that event. So, it is not sufficient to do the check at event submission time, and it must be done separately (when the referenced event is eventually seen for example). For that reason, I do not believe an implementation should be required to reject an event, since this is a redundant check.

Thanks!

Hi! In strfry I'm adding support for deletion of PREs using a-tag references, and I thought I'd use `relay-tester` to double-check the implementation. All good, except I noticed strfry is failing 1 test, the "Accepted deletion of someone else's event". IMO the test is too strict. The test posts an event from user 1, and then has user 2 attempt to delete this using a kind 5 e-tag. It verifies the relay rejects this event. However, strfry does not reject this event, even though it theoretically could. It *is* careful to ensure that the event is not actually deleted though, of course. In the general case, a relay can't know that a referenced event is from another user, since it may not yet have seen that event. So, it is not sufficient to do the check at event submission time, and it must be done separately (when the referenced event is eventually seen for example). For that reason, I do not believe an implementation should be required to reject an event, since this is a redundant check. Thanks!
mikedilger commented 2026-03-14 12:07:58 +13:00 (Migrated from github.com)

I agree with you. The test is too strict. Just ignore it for now since you know better. I think that advice applies to other tests as well. I'll update when I have the chance.

I agree with you. The test is too strict. Just ignore it for now since you know better. I think that advice applies to other tests as well. I'll update when I have the chance.
mikedilger commented 2026-03-14 12:25:02 +13:00 (Migrated from github.com)

I didn't notice this was a PR. I wrote the code and pushed it. Similar to yours.

I didn't notice this was a PR. I wrote the code and pushed it. Similar to yours.
hoytech commented 2026-03-16 11:52:04 +13:00 (Migrated from github.com)

Sweet thanks!

Sweet thanks!

Pull request closed

Sign in to join this conversation.
No description provided.