COVID-19 infection gives some immunity, but virus can still be spread, study finds