fix: address code review issues for embeds implementation

- Fix ?? to || in metadataFetcher.ts to handle empty strings from Cheerio
- Fix stale embeds on message edit: delete old embeds synchronously before
  broadcast, then resolve new ones async (all 4 edit paths: REST+WS, msg+DM)
- Revert unrelated MessageList.tsx scroll threshold change (5000 not 150)
- Remove duplicate embed indexes from migrateAddIndexes (kept standalone ones)
This commit is contained in:
Jannis Braun
2026-03-20 23:58:06 +01:00
parent dcdf10c5de
commit ff2decded5
6 changed files with 30 additions and 23 deletions
@@ -134,7 +134,7 @@ export function MessageList({ channelId, jumpToMessageId, onJumpComplete }: Mess
if (el) {
el.scrollIntoView({ block: 'start' });
const dist = container.scrollHeight - container.scrollTop - container.clientHeight;
const near = dist < 150;
const near = dist < 5000;
setIsNearBottom(near);
isNearBottomRef.current = near;
return;
@@ -218,7 +218,7 @@ export function MessageList({ channelId, jumpToMessageId, onJumpComplete }: Mess
// Check if near bottom
const distanceFromBottom = container.scrollHeight - container.scrollTop - container.clientHeight;
const nearBottom = distanceFromBottom < 150;
const nearBottom = distanceFromBottom < 5000;
setIsNearBottom(nearBottom);
isNearBottomRef.current = nearBottom;