I've fallen for this trap on X (Twitter) far too many times. Chasing engagement and metrics only to discover that when I finally get lots of engagement on a post I hate it - I end up spending far too much time getting into frustrating debates with trolls whose only goal in life seems to be to wind people up. I hardly bother with Twitter nowadays.
The danger is walking straight into the same trap on Medium. Here, trolls aren't so much of a problem - everybody is very respectful of each other - but I still find myself trying to appease the Algorithm God far more than I would like :)