People should really learn to ignore the emotional channel of the comments they receive. Just try to figure out if the message contains any useful information with a quick glance, extract it if it does and ignore the rest. People have to shit - that's physiologically inevitable, and there are people who do it in the streets and there are people who shit in comments/messages. Why take them serious?
This isn't at all the same thing. You were paid to do your job, and at the end of the day you could just joke about those weirdos.
When working on an open-source project, everything becomes much more personal because your motivation is fuelled by your own personal attachement to the project. Imagine you're helping elderly people cross the street every day, and every once in a while they yell at you for not doing it better, whatever that means. At some point is it still worth it?
And of course you can't just put that behind you once you're back home, because this abuse happens at home. I remember this time where someone literally told me to kill myself while I was fixing a bug - at midnight - in a project I handle. Or the time I woke up only to see that during the night someone public had decided to openly send me literal fuck emojis on Twitter to right a perceived wrong. Good times.
So yeah - building a shell is the right solution, but it's hard and we really shouldn't have to deal with that in the first place.