fix: improve task event filtering in activities feed

Filter by both event-type:task tag and presence of status tag
(NIP-52 calendar events don't have status on kind 31922, only
on RSVP kind 31925). This catches manually-created task events
that may not have the event-type tag.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Padreug 2026-04-27 00:12:12 +02:00
commit cf08b76515

View file

@ -135,9 +135,12 @@ export class ActivitiesNostrService extends BaseService {
* Parse a raw Nostr event into an Activity view model. * Parse a raw Nostr event into an Activity view model.
*/ */
private parseNostrEventToActivity(event: NostrEvent): Activity | null { private parseNostrEventToActivity(event: NostrEvent): Activity | null {
// Skip task events (they reuse kind 31922 but tag with event-type:task) // Skip task events — they reuse NIP-52 kinds but can be identified by
const eventType = event.tags?.find(tag => tag[0] === 'event-type')?.[1] // task-specific tags (event-type:task, status, recurrence)
if (eventType === 'task') return null const tags = event.tags ?? []
const eventType = tags.find(tag => tag[0] === 'event-type')?.[1]
const hasStatus = tags.some(tag => tag[0] === 'status')
if (eventType === 'task' || hasStatus) return null
if (event.kind === NIP52_KINDS.CALENDAR_TIME_EVENT) { if (event.kind === NIP52_KINDS.CALENDAR_TIME_EVENT) {
const parsed = parseCalendarTimeEvent(event) const parsed = parseCalendarTimeEvent(event)