Scenario:
SDE database. Feature class registered as versioned. Traditional versioning with DEFAULT version only. Version access public. ArcGIS Pro Options | Editing | “Enable and disable from the Edit tab” = True and “Single workspace edit session” selected.
Behavior using esri_editing_ToggleEditBtn:
Two separate ArcGIS Pro instances open. Start editing in instance 1 using the Ribbon | Edit tab | Edit button (esri_editing_ToggleEditBtn). Edit attribute in feature class. Save edits and stop editing. Start editing in instance 2 using the esri_editing_ToggleEditBtn. Attributes in same feature class in instance 2 refresh with edit made in instance 1.
Behavior using SetIsEditingEnabledAsync:
Same two separate ArcGIS Pro instances open. Start editing in instance 1 using the esri_editing_ToggleEditBtn. Edit attribute in feature class. Save edits and stop editing. Start editing in instance 2 using Project.Current.SetIsEditingEnabledAsync(true). Following pattern shown here: https://github.com/Esri/arcgis-pro-sdk/wiki/ProSnippets-Editing#enable-editing-1. Attributes in feature class in instance 2 DO NOT refresh to edit made in instance 1.
Attempts to refresh otherwise:
I have tried running the following in an awaited QueuedTask prior to running SetIsEditingEnabledAsync from another awaited QueuedTask:
var connectionString = new Uri("C:\\dir\\my_sde.sde");
using var gdb = new Geodatabase(new DatabaseConnectionFile(connectionString));
using var versionManager = gdb.GetVersionManager();
using var version = versionManager.GetCurrentVersion();
version.Refresh();If an edit session was previously started via SetIsEditingEnabledAsync, then version.Refresh() throws error: ArcGIS.Core.Data.Exceptions.GeodatabaseEditingException: 'This operation is not allowed while editing.' This occurs even after having run Project.Current.SetIsEditingEnabledAsync(false);.
Questions:
Why does Project.Current.SetIsEditingEnabledAsync(true) not refresh attributes the same way the esri_editing_ToggleEditBtn does?
What is the best way to refresh attributes when starting an edit session via Project.Current.SetIsEditingEnabledAsync(true)?