irislib / iris-messenger

Decentralized messenger
https://iris.to
MIT License
719 stars 157 forks source link

Minor code bugs and issues #432

Open keutmann opened 1 year ago

keutmann commented 1 year ago

Some small findings, that you may want to look at ;)

File: Events.ts Method: handle() Issue: isRepost is never true

Sample case 1: this.maybeAddNotification(event); if (isRepost(event)) { // isRepost is never true this.handleRepost(event); } else { this.handleNote(event); } break;


File:Events.ts Method: handle() Issue: Double check of event, EventDB.findOne and in this.handleFollowList(event)

Sample: case 3: { // This code is also checked in handleFollowList const foundEvent = EventDB.findOne({ kinds: [3], authors: [event.pubkey] }); if (foundEvent && foundEvent.created_at >= event.created_at) { return false; } this.maybeAddNotification(event); this.handleFollowList(event); break; }


File: SocialNetwork.ts Method: block() Issue: content will contain the IDs (number) and not the hex keys of the blocklist. Sample: let content: any = JSON.stringify(Array.from(this.blockedUsers)); // ID are rendered and not hex keys. content = await Key.encrypt(content);