It's better to prevent the invasion, but supposedly they could've actually repelled Moroccans out of luck, it can be quite a boost of morale and prestige to then in-declining empire. But who knows how much loss they'll suffer at Tondibi.
My thinking is that while it won't likely buy Songhay so much time, it might perhaps preserve some sort of political unity in much of Sahel. Or at least something of a new order.