Things I lose sleep over: How does the server handle this: (?)

If I have a player map in my game and as players join I add to the map and as they leave the game I have to rebuild the map without the player since there is no way to remove a player from a map. What happens if a new player joins and leaves at the exact same time? Is it possible that while rebuilding my map, from the exiting player, I could lose the player that was added? Do leaves and joins happen in separate server ticks? Is the server smart enough to handle this?

I pasted the above question into the developer assistant.

The TL;DR :
The server is smart enough.