On the activity webpage on Strava, click the "..." and "correct elevation" to have your log look reasonable.
But even that will be subject to algorithms used by Strava. Garmin Connect offers the same feature.
Online and computer (mapping) systems calculate a route ascent by looking at altitude along your chosen route or track. But they don't know the altitude at every point along your route so they have to interpolate between points nearby they do have the altitude for. Most use SRTM (Shuttle Radar Topography Mission) which provides altitude for a grid with between 100m and 30m spacing over much of the surface of the Earth but with constraints.
How useful interpolating points 100m apart depends on the landscape. Gentle long slopes, etc. it might work well but other areas eg with clifs and steep hills it is pretty poor. eg Look at an altitude profile online systems generate cycling up Eurovelo 6 through the Doubs valley in France. mHorrible and expect a few hard days ... except the path you take is right next to the river and pretty flat and level as you ride sometimes next to cliffs, sometimes more open areas with steeper hills both sides, etc.
Constraints and sources of error are eg the SRTM sensors detect the altitude of eg top of trees as their signal can't get to the ground so move from open ground into a forect along flat ground and SRTM will suggest you altitude has jumped by the height of the trees. But subsequent processing has removed some of these forest anomalies. But different grid spacings have been released at different times for different areas of the world and users of the data taken the updated data at their convenience (id atall).
TL;DR on device vs computer "corrected" have constraints and at best useful only for comparing different rides on different days ignoring the units eg today I did 300<whatevers> where yesterday <150<whatevers> to today was twice the ascent. Relevant number is "today twice the ascent".