The World Federation One Stop Fiqh

Ruling 1152

If a person has a doubt that invalidates prayers, it is better that he does not break his prayer as soon as the doubt arises; rather, he should think [about the doubt] to the extent that the form of the prayer breaks up or until he loses hope in attaining certainty or a supposition [about what he has or has not performed].