Under endless threat from larger competitors like Meta and TikTok, the social media app managed to surprise Wall Street this week. There was a moment when Snapchat looked like it was destined to be a relic in social media history, losing users and missing its own revenue forecasts.