I made a tool that adds some features into a layer which has to be in an edit session. But also noticed that if I want to stop edit session without saving changes my new features still exist in layer. Used this kind of adding features
vlayer = iface.activeLayer() if vlayer.isEditable(): vlayer.dataProvider().addFeatures([feature]) # QgsFeature() with geometry
Looks like Qgis thinks that I add them in non-edit session. Any way to make it waiting for comitting results?