Coffee journaling on ATProto (alpha) alpha.arabica.social
coffee

fix: skip like records before feed item conversion (#6)

Likes are indexed for like counts but should not appear as standalone
feed items. Previously, they were filtered inside recordToFeedItem(),
which caused unnecessary warning logs. Now they're skipped earlier in
the processing loop, avoiding the warning entirely.

Fixes: 01KGGK6V4WMC

Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>

authored by

Patrick Dewey
Claude Sonnet 4.5
and committed by
GitHub
b0f30efb 7fac9eaa

+7 -2
+7 -2
internal/firehose/index.go
··· 428 // Convert to FeedItems 429 items := make([]*FeedItem, 0, len(records)) 430 for _, record := range records { 431 item, err := idx.recordToFeedItem(ctx, record, recordsByURI) 432 if err != nil { 433 log.Warn().Err(err).Str("uri", record.URI).Msg("failed to convert record to feed item") ··· 580 item.Brewer = brewer 581 582 case atproto.NSIDLike: 583 - // Skip likes in the feed - they're indexed but not displayed as feed items 584 - return nil, fmt.Errorf("likes are not displayed as feed items") 585 586 default: 587 return nil, fmt.Errorf("unknown collection: %s", record.Collection)
··· 428 // Convert to FeedItems 429 items := make([]*FeedItem, 0, len(records)) 430 for _, record := range records { 431 + // Skip likes - they're indexed for like counts but not displayed as feed items 432 + if record.Collection == atproto.NSIDLike { 433 + continue 434 + } 435 + 436 item, err := idx.recordToFeedItem(ctx, record, recordsByURI) 437 if err != nil { 438 log.Warn().Err(err).Str("uri", record.URI).Msg("failed to convert record to feed item") ··· 585 item.Brewer = brewer 586 587 case atproto.NSIDLike: 588 + // This should never be reached - likes are filtered before calling recordToFeedItem 589 + return nil, fmt.Errorf("unexpected: likes should be filtered before conversion") 590 591 default: 592 return nil, fmt.Errorf("unknown collection: %s", record.Collection)