COMMENTARY on 4:17
Mustafa Khattab:

Translation:
Allah only accepts the repentance of those who commit evil ignorantly ˹or recklessly˺ then repent soon after6—Allah will pardon them. And Allah is All-Knowing, All-Wise.
Commentary:
6   A person’s repentance will be accepted as long as they repent any time before their death. But one should not procrastinate because they do not know when they will die.

 

Muhammad Asad:

Translation:
Verily, God's acceptance of repentance relates only to those who do evil out of ignorance and then repent before their time runs out: 15 and it is they unto whom God will turn again in His mercy - for God is all-knowing, wise;
Commentary:
15  The expression min qarib, which here implies nearness in time, could also be rendered as "soon", i.e., soon after having committed the evil deed; most of the classical commentators, however, hold that in this context it denotes the time before the actual approach of death. This interpretation is borne out by the next verse.