All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah and that Muhammad, sallallaahu ‘alayhi wa sallam, is His slave and messenger.
According to Muslim scholars, the sound opinion is that swallowing mucus does not nullify one's fasting, particularly if one forgetfully swallows it or swallows it involuntarily. Allah Says (what means) : {…(Allah) has not placed upon you in the religion any difficulty...}[Quran 22:78] Yet, it is better for the fasting person to guard oneself against swallowing mucus as much as possible.
Allah knows best.