Barcelona and Wojciech Szczesny have reached an agreement for the goalkeeper to join the club on a loan deal until 30 June 2025.