Threads sometimes don't render in correct order #386

Closed
opened 2023-03-03 19:33:12 +00:00 by SamSamskies · 10 comments
SamSamskies commented 2023-03-03 19:33:12 +00:00 (Migrated from github.com)

Describe the bug
In this screenshot, the selected note is a response to my note below it, but it's being shown as a response to the note at the top.

Screenshot 2023-03-03 at 1 27 52 PM

The order of the tags in the debug json look correct

{
  "content": "Oh, cool",
  "created_at": 1677871124,
  "id": "5fad2ba5080627514e12e890d0ec14f7b4a0942694041837656f8a5a1778866a",
  "kind": 1,
  "pubkey": "69074169ed68fa74c37d3926359f4100635c37eea5cfece064ed022ed06f792b",
  "sig": "34523391eeb7bcc6ea3c26cd05ff122d32da7c897ce35706533b71364c16ce195bb653e901b3fe5f966c5665af612f09b73c4d8f81020684c82c4877e022bc42",
  "tags": [
    [
      "e",
      "bca08e633fd7319e134fc8112646268eaa76c3453ecf242cdf40d342eee80f4d"
    ],
    [
      "e",
      "e29a06d29922f7f3e051429ce83b948bdcd9ed5cac15571a85361365b749c155"
    ],
    [
      "e",
      "ed3bf80b3905dea7468f292e45ef55a3e056a9d97f95f88cffe2661d145b09f0"
    ],
    [
      "p",
      "69074169ed68fa74c37d3926359f4100635c37eea5cfece064ed022ed06f792b"
    ],
    [
      "p",
      "63fe6318dc58583cfe16810f86dd09e18bfd76aabc24a0081ce2856f330504ed"
    ],
    [
      "p",
      "604e96e099936a104883958b040b47672e0f048c98ac793f37ffe4c720279eb2"
    ]
  ],
  "relays": [
    "wss://filter.nostr.wine/npub1vp8fdcyejd4pqjyrjk9sgz68vuhq7pyvnzk8j0ehlljvwgp8n6eqsrnpsw"
  ]
}

To Reproduce
Steps to reproduce the behavior:

  1. Go to https://snort.social/e/note1t7kjhfggqcn4znsjazgdpmq57762p9pxjszpsdm9d79959mcse4qk0846t
**Describe the bug** In this screenshot, the selected note is a response to my note below it, but it's being shown as a response to the note at the top. ![Screenshot 2023-03-03 at 1 27 52 PM](https://user-images.githubusercontent.com/3655410/222809611-e3102e60-cdc0-4789-a7e1-5df794f93f3e.png) The order of the tags in the debug json look correct ```json { "content": "Oh, cool", "created_at": 1677871124, "id": "5fad2ba5080627514e12e890d0ec14f7b4a0942694041837656f8a5a1778866a", "kind": 1, "pubkey": "69074169ed68fa74c37d3926359f4100635c37eea5cfece064ed022ed06f792b", "sig": "34523391eeb7bcc6ea3c26cd05ff122d32da7c897ce35706533b71364c16ce195bb653e901b3fe5f966c5665af612f09b73c4d8f81020684c82c4877e022bc42", "tags": [ [ "e", "bca08e633fd7319e134fc8112646268eaa76c3453ecf242cdf40d342eee80f4d" ], [ "e", "e29a06d29922f7f3e051429ce83b948bdcd9ed5cac15571a85361365b749c155" ], [ "e", "ed3bf80b3905dea7468f292e45ef55a3e056a9d97f95f88cffe2661d145b09f0" ], [ "p", "69074169ed68fa74c37d3926359f4100635c37eea5cfece064ed022ed06f792b" ], [ "p", "63fe6318dc58583cfe16810f86dd09e18bfd76aabc24a0081ce2856f330504ed" ], [ "p", "604e96e099936a104883958b040b47672e0f048c98ac793f37ffe4c720279eb2" ] ], "relays": [ "wss://filter.nostr.wine/npub1vp8fdcyejd4pqjyrjk9sgz68vuhq7pyvnzk8j0ehlljvwgp8n6eqsrnpsw" ] } ``` **To Reproduce** Steps to reproduce the behavior: 1. Go to https://snort.social/e/note1t7kjhfggqcn4znsjazgdpmq57762p9pxjszpsdm9d79959mcse4qk0846t
Giszmo commented 2023-04-10 12:54:59 +00:00 (Migrated from github.com)

This issue is very consistently experienced here, too. All the time. Bounty anybody?

This issue is very consistently experienced here, too. All the time. Bounty anybody?
Contributor

So I think the issue is not with Snort actually.

https://snort.social/e/note1xm4je4emz8jklqra5h5zean79zqan76mtakwpg60wvh2yk69dsmswvxdvs

What appears to be happening is that some clients still work with positional e-tags but they copy over all e-tags of the replied to note with the markers.

  1. Alice: id1, no tags
  2. Bob: id2, tag ["e",id1,,"reply"]
  3. Carol: id3, tag ["e",id2], tag ["e",id1,,"reply"]

Clients that ignore markers make sense of it correctly so it appears as a bug in Snort while it's actually a bug in these other clients. Or is it a bug in how we upgraded the nip?

So I think the issue is not with Snort actually. https://snort.social/e/note1xm4je4emz8jklqra5h5zean79zqan76mtakwpg60wvh2yk69dsmswvxdvs What appears to be happening is that some clients still work with positional e-tags but they copy over all e-tags of the replied to note **with the markers**. 1. **Alice:** id1, no tags 1. **Bob:** id2, tag `["e",id1,,"reply"]` 1. **Carol:** id3, tag `["e",id2]`, tag `["e",id1,,"reply"]` Clients that ignore markers make sense of it correctly so it appears as a bug in Snort while it's actually a bug in these other clients. Or is it a bug in how we upgraded the nip?

Thanks a lot for looking into this, our thread logic looks for ANY marker (root/reply) to determine which thread kind it is, maybe we should look for root tag if reply tag exists to switch to marked mode?

Thanks a lot for looking into this, our thread logic looks for ANY marker (root/reply) to determine which thread kind it is, maybe we should look for root tag if reply tag exists to switch to marked mode?
Contributor

Snort is not responsible for fixing buggy other clients. They also copy the "root" marker but promised to fix that copying with the next release.

That said, Snort is definitely doing something weird on top of this other client issue.

I just replied to a Note and my reply snug in between the replied-to Note and another old reply to that same Note.

note18zfehjtph8cesh0d42rdmp3y5mluydjcw4v7r9yeyy2tsh4sqm9ssf6s93

Look at these timestamps.

Screenshot from 2023-05-11 10-37-14.png

Snort is not responsible for fixing buggy other clients. They also copy the "root" marker but promised to fix that copying with the next release. That said, Snort is definitely doing something weird on top of this other client issue. I just replied to a Note and my reply snug in between the replied-to Note and another old reply to that same Note. note18zfehjtph8cesh0d42rdmp3y5mluydjcw4v7r9yeyy2tsh4sqm9ssf6s93 Look at these timestamps. ![Screenshot from 2023-05-11 10-37-14.png](/attachments/44db6d8f-a887-42e1-b9b0-695919f0a8e0)

I think its correct no? New replies are always at top in the chain, you replied to Byrdman and Jeff also replied to Byrdman but earlier so its at the bottom?

I think its correct no? New replies are always at top in the chain, you replied to Byrdman and Jeff also replied to Byrdman but earlier so its at the bottom?
Contributor

No. The line running through our avatars implies that Jeff replied to me. In fact I assume it would look just the same if that were the case. Other clients have such a line but shift every level of reply a bit to the right. Amethyst for example.

No. The line running through our avatars implies that Jeff replied to me. In fact I assume it would look just the same if that were the case. Other clients have such a line but shift every level of reply a bit to the right. Amethyst for example.
Contributor

There is clearly a bug here. Check out

https://snort.social/e/note1gd9dffjxc2xeraxmstadfxpxzyh5up27fjg4cl3ntvja73y3lyeqlyjpu2

Screenshot from 2023-06-01 19-32-28.png

I replied to Derek and he replied to me, yet Snort shows it as a reply to self.

The top three events as in the screenshot are:

{
  "content": "This is the problem with Lightning....
  "id": "868187063f...
  "tags": [
    [ "e", "cbf2375078...
    [ "e", "977ac5d3b6...
    [ "e", "8f99ca1363...
  ]
}

{
  "content": "This is a good point, but your ...
  "id": "434ad4a646...
  "tags": [
    [ "e", "cbf2375078...
    [ "e", "868187063f...
    [ "e", "6834ffc491...
  ]
}

{
  "content": "There is some middle ground ...
  "id": "6834ffc491...
  "tags": [
    [ "e", "cbf2375078..., "", "root"
    [ "e", "868187063f..., "", "reply"
  ]
}

According to https://github.com/nostr-protocol/nips/blob/master/10.md the last e-tag defines what the reply was to. Snort takes the second e-tag?

There is clearly a bug here. Check out https://snort.social/e/note1gd9dffjxc2xeraxmstadfxpxzyh5up27fjg4cl3ntvja73y3lyeqlyjpu2 ![Screenshot from 2023-06-01 19-32-28.png](/attachments/5d57be6e-c507-4534-a837-4e7e115d8b61) I replied to Derek and he replied to me, yet Snort shows it as a reply to self. The top three events as in the screenshot are: ``` { "content": "This is the problem with Lightning.... "id": "868187063f... "tags": [ [ "e", "cbf2375078... [ "e", "977ac5d3b6... [ "e", "8f99ca1363... ] } { "content": "This is a good point, but your ... "id": "434ad4a646... "tags": [ [ "e", "cbf2375078... [ "e", "868187063f... [ "e", "6834ffc491... ] } { "content": "There is some middle ground ... "id": "6834ffc491... "tags": [ [ "e", "cbf2375078..., "", "root" [ "e", "868187063f..., "", "reply" ] } ``` According to https://github.com/nostr-protocol/nips/blob/master/10.md the **last** e-tag defines what the reply was to. Snort takes the second e-tag?
Contributor
https://git.v0l.io/Kieran/snort/src/branch/main/packages/app/src/System/EventExt.ts#L92 is buggy.

Its possible that some clients were creating unmarked threads with root/reply tags first and thats why we did it like this

Its possible that some clients were creating unmarked threads with root/reply tags first and thats why we did it like this
Contributor

for n=2, it's right to do it that way but in all other cases it is wrong. Please fix it.

for n=2, it's right to do it that way but in all other cases it is wrong. Please fix it.
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 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: Kieran/snort#386
No description provided.