Skip to content

Conversation

xdamman
Copy link

@xdamman xdamman commented Jun 13, 2025

When fetching posts, it queries KINDS.GROUP_POST:

const posts = await nostr.query([{
kinds: [KINDS.GROUP_POST],
"#a": [communityId],
limit: 50,
}], { signal });

But when fetching approved posts, it doesn't check the kind of the post that has been approved:

const approvedPost = JSON.parse(approval.content) as NostrEvent;
// Skip if the post itself is a reply
if (approvedPost.kind === KINDS.GROUP_POST_REPLY) {
return null;
}

So you could end up with any random kind of post approved by another app that Chorus doesn't know how to render.

This tiny PR fixes it.

When fetching posts, it queries KINDS.GROUP_POST. But when fetching approved posts, it doesn't check the kind of the post that has been approved. This fixes it.
@alexgleason
Copy link
Member

Hi there, thanks for this patch! It looks like there's a type error in the CI.

@xdamman
Copy link
Author

xdamman commented Jun 13, 2025

Ah indeed, pushed an update. npm run ci now runs properly locally.

What prettier config are you using? My IDE (cursor) keeps on reformatting everything on save which makes pull requests quite unreadable. Might be good to add a .prettierrc in the project.

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

Successfully merging this pull request may close these issues.

2 participants