nip-10: fix duplicate replies in feed #60

Merged
offbyn merged 1 commits from duplicate-replies into master 1 year ago
offbyn commented 1 year ago
Owner

some replies rendered twice in different positions, seems to be
related to deprecated positional event tags and a regression
introduced in a596121821

added 2 new functions to get reply to and replies of an event.
these functions are not pretty but should follow nip-10 with
correct fallback.

example event that had some replies rendered twice:
22e4ea80161ac591059da611d3ab63c583cb1d47a706826db2fc6955ac0a70b5

some replies rendered twice in different positions, seems to be related to deprecated positional event tags and a regression introduced in a5961218218ab956b13a2437c6f16c658a88b610 added 2 new functions to get reply to and replies of an event. these functions are not pretty but should follow nip-10 with correct fallback. example event that had some replies rendered twice: 22e4ea80161ac591059da611d3ab63c583cb1d47a706826db2fc6955ac0a70b5
offbyn added 1 commit 1 year ago
ci/woodpecker/push/woodpecker Pipeline was successful Details
ci/woodpecker/pr/woodpecker Pipeline was successful Details
522f117d82
nip-10: fix duplicate replies in feed
some replies rendered twice in different positions, seems to be
related to deprecated positional event tags and a regression
introduced in a596121821

added 2 new functions to get reply to and replies of an event.
these functions are not pretty but should follow nip-10 with
correct fallback.

example event that had some replies rendered twice:
22e4ea80161ac591059da611d3ab63c583cb1d47a706826db2fc6955ac0a70b5
offbyn reviewed 1 year ago
src/main.js Outdated
@ -697,0 +736,4 @@
// nip-10: fallback to deprecated positional 'e' tags
return eventTags.at(-1)[1] === evt.id;
}
);
offbyn commented 1 year ago
Poster
Owner

so ugly 🙈

so ugly 🙈
offbyn marked this conversation as resolved
offbyn commented 1 year ago
Poster
Owner

now it does that on every render. thinking about it again, it would be better to read and transform the data when receiving events, instead.

now it does that on every render. thinking about it again, it would be better to read and transform the data when receiving events, instead.
offbyn changed title from nip-10: fix duplicate replies in feed to draft: nip-10: fix duplicate replies in feed 1 year ago
offbyn force-pushed duplicate-replies from 522f117d82 to f33639fa60 1 year ago
offbyn force-pushed duplicate-replies from f33639fa60 to 2e40a273c4 1 year ago
offbyn changed title from draft: nip-10: fix duplicate replies in feed to nip-10: fix duplicate replies in feed 1 year ago
offbyn merged commit 2e40a273c4 into master 1 year ago
offbyn deleted branch duplicate-replies 1 year ago
ci/woodpecker/pr/woodpecker Pipeline was successful
ci/woodpecker/push/woodpecker Pipeline was successful
The pull request has been merged as 2e40a273c4.
You can also view command line instructions.

Step 1:

From your project repository, check out a new branch and test the changes.
git checkout -b duplicate-replies master
git pull origin duplicate-replies

Step 2:

Merge the changes and update on Gitea.
git checkout master
git merge --no-ff duplicate-replies
git push origin master
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: nostr/nostrweb#60
Loading…
There is no content yet.