وَلَمْ يَخْفَ عَلَيْهِ شَيْءٌ مِنْ أَفْعَالِهِمْ قَبْلَ أَنْ خَلَقَهُمْ
Before creating them, none of their actions was hidden from Allah.
Divine knowledge is not acquired after a creature performs an act. Actions that occur in time are already known to Allah before they happen.
Ignorance followed by discovery does not apply to His knowledge.