That’s right; what we called the “Soviet invasion of Afghanistan” in 1979 was actually aid to an Afghan government that requested the help (just as we did in Vietnam). In the same way, the cost of the intervention was too high, the Soviets pulled out after a long war, and the government they assisted survived a few more years without them before crashing & burning.
Well, in both cases the governments requesting help were puppets. So “invasion” still fits IMO.