editing line items for contributions linked to membership extends the end date on every save
To reproduce, create a membership with payment. Edit the contribution's line item and save. The membership end date will be extended every time you do this.
The problem is in CRM_Lineitemedit_Form_Edit::updateEntityRecord(). We trigger the API3 membership.create call which will extend the end date if an ID is passed. I updated that code to use API4 membership.update and the behavior is corrected. I'll supply a PR shortly.