Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor code bugs and issues #432

Open
keutmann opened this issue Sep 11, 2023 · 0 comments
Open

Minor code bugs and issues #432

keutmann opened this issue Sep 11, 2023 · 0 comments

Comments

@keutmann
Copy link
Contributor

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);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant