I think you need to update the contact regardless of what's stored already - but preserve the presence value (or set it to disconnected). So you could do something like

contact.presence = this.getPresence(contact.username);
this.set(contact.username, contact);

If you do that without the if statement it'll do the update correctly.

Also please extend the updateContacts documentation with the fact that it preserves the presence property for contacts.