prevLengthRef.current was never zeroed when conversationId changed, so the first batch of messages in a new (shorter) conversation would not trigger scrollIntoView. Reset it in the polling useEffect cleanup.
prevLengthRef.current was never zeroed when conversationId changed, so the first batch of messages in a new (shorter) conversation would not trigger scrollIntoView. Reset it in the polling useEffect cleanup.