Ionosphere.tv
3
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix: getMentions handles multiple talk URIs for same rkey

Talks may exist under different DIDs for the same rkey. Query all
matching URIs to find all associated mentions.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

+7 -4
+7 -4
apps/ionosphere-appview/src/routes.ts
··· 275 275 const talkRkey = c.req.query("talkRkey"); 276 276 if (!talkRkey) return c.json({ mentions: [], total: 0 }); 277 277 278 - const talk = db.prepare("SELECT uri FROM talks WHERE rkey = ?").get(talkRkey) as any; 279 - if (!talk) return c.json({ mentions: [], total: 0 }); 278 + // Get all talk URIs for this rkey (may be multiple DIDs) 279 + const talkRows = db.prepare("SELECT uri FROM talks WHERE rkey = ?").all(talkRkey) as any[]; 280 + if (!talkRows.length) return c.json({ mentions: [], total: 0 }); 281 + const talkUris = talkRows.map((r: any) => r.uri); 282 + const talkPlaceholders = talkUris.map(() => "?").join(","); 280 283 281 284 const topLevel = db.prepare( 282 285 `SELECT m.*, p.handle as author_handle, p.display_name as author_display_name, p.avatar_url as author_avatar_url 283 286 FROM mentions m 284 287 LEFT JOIN profiles p ON m.author_did = p.did 285 - WHERE m.talk_uri = ? AND m.parent_uri IS NULL 288 + WHERE m.talk_uri IN (${talkPlaceholders}) AND m.parent_uri IS NULL 286 289 ORDER BY 287 290 CASE m.mention_type WHEN 'during_talk' THEN 0 ELSE 1 END, 288 291 m.talk_offset_ms ASC, 289 292 m.created_at ASC` 290 - ).all(talk.uri); 293 + ).all(...talkUris); 291 294 292 295 const replyStmt = db.prepare( 293 296 `SELECT m.*, p.handle as author_handle, p.display_name as author_display_name, p.avatar_url as author_avatar_url