The Torah has already promised that, in the end, Israel will repent at the end of their exile and immediately they will be redeemed.

כבר הבטיחה תורה שסוף ישראל לעשות תשובה בסוף גלותן ומיד הן נגאלין
Shiurim in this topic
5842. Immediate Redemption in Tanya and Its True Meaning גאולה מידית בתניא ומשמעותה האמיתית