The smart isNearBottomRef gating was too restrictive — own sent messages, image-loads, and incoming partner messages were sometimes not scrolled to. Adopt the room-chat pattern: always scroll on messages.length change and onContentSizeChange. Drop isNearBottomRef + firstContentSizeChangeRef + onScroll handler.