We used to avoid this during the time of the Messenger of Allah ﷺ.
حدثنا هناد حدثنا وكيع عن سفيان عن يحيى بن هانئ بن عروة المرادي عن عبد الحميد بن محمود قال صلينا خلف أمير من الأمراء فاضطرنا الناس فصلينا بين الساريتين فلما صلينا
كنا نتقي هذا على عهد رسول الله ﷺ
No references are available.
Its isnad is sahih. Abu Dawud reported it, no. 673, from the hadith of Sufyan Thawri through the same chain, and he made clear that he heard it directly, as recorded by Bayhaqi, 3/104. Ibn Khuzayma graded it sahih, no. 1568, as did Ibn Hibban (al-Ihsan), 2215, and Hakim, 1/210, 218, and Dhahabi agreed with him. Abdul-Hameed is trustworthy, as stated in al-Kashif and elsewhere.On this subject there is also a report from Qurra bin Iyas Muzani [Ibn Majah, no. 1002].