That's kind of the point of a UPS. Uninterruptable Power Supply. If you have to plug things in and out when there are blackouts it kind of defeats the point.
That being said the lifespan of the batteries is often compromised by poorly designed charger circuits which may continually over charge batteries at 100% capacity by trickle charging them too much. This applies to lead acid and lithium based batteries. Some intelligent chargers (like some CTek and Victron units) will charge a battery to 100% capacity, float for a couple of hours before stopping the charge entirely. Then they periodically check the battery every few hours and top it up if required. Some even perform a small discharge/recharge cycle once per week to keep batteries in tip top shape.
A dumb trickle charger will not get the most out of batteries but may be good enough for a small consumer UPS. To get the longest service life out of lithium based batteries you generally want to charge to about 90% capacity and not 100%. Some laptops have driver software to limit the SoC at the expense of a bit of capacity. I rememer using an old HP laptop that had that feature.
Gory details:
A complete guide on how to charge lithium iron phosphate (LiFePO4) batteries. Learn about the charging of a lithium battery from Power Sonic
www.power-sonic.com