franzaps / zapthreads

The Unlicense
33 stars 8 forks source link

If the reply has an `e` tag that doesn't match the current `id` of the replaceable event, display a notice #35

Closed fiatjaf closed 11 months ago

fiatjaf commented 1 year ago

Pseudocode:

if root.kind > 10000 and current_reply.has_tag('e') and current_reply.get_tag('e') !== root.id:
    display_warning = True

Something like this (obviously just an idea):

2023-10-14-080204_653x298_scrot

I was trying to implement it, but I figured I would make a big mess in the code, so I decided to just open this issue instead.

franzaps commented 1 year ago

Yes, this was exactly my idea. I will implement it.

franzaps commented 1 year ago

Found an issue. A kind 1 event showed up with a single e tag and a single a tag.

Since the e tag value was an unknown event, I showed the warning notice (assuming this value could have been a replaced 30023 event).

It turns out that e tag value was a pointer to a highlight (kind 9802) that was not loaded, probably as it was outside of the current relay set.

We will likely encounter false positives like these. We need a different language than "in reply to a different version of this article" as that may simply not be true.

fiatjaf commented 1 year ago

So someone made a highlight Y referencing an event X and someone replied to the highlight and included both X and Y as tags?

franzaps commented 1 year ago

@fiatjaf Yes, exactly. The e tag has no marker so it's difficult to say what it's referencing. The highlight eventually appeared so this stopped being a problem, but it could happen again

franzaps commented 1 year ago

I'm solving it like this for now:

These events do exist and are of type 9801. Who knows wth that kind is.

franzaps commented 11 months ago

Addressed and significantly improved in https://github.com/fr4nzap/zapthreads/commit/f82d58ec8c64f7a8c4b4e018687c9f8c89b358b8