vishalxl / nostr_console

Nostr console is an open-source twitter-like social network, direct chat app and group chat all bundled into one program. Built on the decentralized Nostr protocol.
GNU Affero General Public License v3.0
441 stars 33 forks source link

[BUG] Unable to select full Event ID when replying to multiple Event ID's with six leading zeros (Eg: PoW 25 event) #63

Open Sakhalinfox opened 1 year ago

Sakhalinfox commented 1 year ago

Issue Description

I created two PoW post/reply events consisting of 6 leading zeros '000000' in the event ID by performing a --difficulty PoW of 25 leading zero bits. Nostr_Console currently displays event ID's of posts and replies of up to 6 characters in length. So, if I had to reply the third time and entered '000000' in the event ID input where it says -'Type id of event to reply to (leave blank to make a new post; type x to cancel)' it will only reply to the latest Event ID that begins with '000000', instead of informing the user that it found duplicate event ID's that began with '000000'. Ideally, the console should provide the user with the full length event ID's of the duplicate event ID's so that the user can select and copy/paste them for their next reply/response as a choice.

Steps to Reproduce

  1. Create A new PoW 25 leading zero post. This should display the event ID '000000' image

  2. Reply to the above post with another PoW 25 leading zero reply. This should display the event iD '000000' for the reply post. image

  3. Create another reply post, Nostr_Console should ask you to input the Event ID to reply to. Enter '000000'. However, it responds directly to the reply created in point 2 instead of providing the user the option to view the complete event ID of the events that have duplicate event ID's that begin with '000000' and selecting them to reply to the appropriate one. image

Expected Result

Provide the user a list of duplicate Event ID's that have the same initial 6 characters of the Event ID. This way the user can select, copy/paste the entire Event ID to respond to the right post that they desire.

I feel one way to handle this would be to also show the last 6 characters of the event ID apart from the beginning 6 separated with a delimiter like ':' (colon) or ellipses '....' Eg: 000000:25436d or 000000...25436d. The user can then copy that and Nostr_Console could accept that shortened event ID as an input for replying to posts or creating posts.

Example reproduction details Event ID: 0000000862cc44026e6609e5886c7384dc6c237a43739d2a0171d2046425436d Note ID: note1qqqqqzrze3zqymnxp8jcsmrnsnwxcgm6gdee62spw8fqgep9gdks4x9d3n

Test Environment Details

vishalxl commented 1 year ago