Generally speaking, prior coronavirus infection provides durable protection against severe disease that is similar to two doses of the mRNA vaccines through at least 40 weeks. Protection against reinfection and symptomatic disease has declined amidst Omicron (likely substantially so for the new variants- this meta-analysis only covers up to BA.1 and BA.5).
A few important caveats with this review. They had limited data on protection against severe disease. Likewise they only had a few studies of the Omicron period, and no studies of the latest variants. We are seeing the latest variants have substantial immune evasion, so it is likely protection is lower for these variants.
I don't think the takeaway is much different than I have been saying this entire pandemic. Vaccination is the safest way to get protection against coronavirus infection, disease, and long COVID. The risks of disease and long COVID are unpredictable. However prior infection can provide protection, particularly against severe disease. Ideally those with prior infections should get hybrid immunity with vaccination. Studies have consistently shown that those with hybrid immunity from both prior infection and vaccination get an additional benefit that is superior.
One important note with this discussion is that protection conferred by prior infection is more variable than with vaccination. This is why those with prior infections should still get vaccinated. There is no guarantee that they will have immunity.
Staying up to date on vaccination is important as the coronavirus mutates. As we saw in this review, while protection was high for Omicron, it did decline compared to previous strains, and significantly so for infection and symptomatic disease. Boosting provides a very low risk way to restore protection against variants. However if you have been recently infected you can likely wait to get boosted- unless you are immunocompromised or at high risk of severe disease.
At this stage in the pandemic there are not many people that have no history of vaccination or prior infection. This has thankfully helped keep hospitalizations and deaths down. We'll have to see if this continues. The virus is always mutating.