A coronavirus infection prevents a subsequent one, but only if it is a similar variant

Being infected with a SARS-CoV-2 variant prior to omicron protects against possible reinfection, although the effect fades almost completely after three years.