Can't change GoDocument.IsModified

From the documentation:

The GoDocument.IsModified property is set to true by GoDocument.OnChanged. You will need to set this property to false whenever you store or reload your document.

But when I set IsModified = false, I can see while debugging that it doesn’t change and remains “true”.

The only way I can see that happening is if there is an edit transaction still in progress.

Check to see if UndoManager.CurrentEdit != null

Ah, I see my problem.

After loading the document, there is business analysis that feeds back results into secondary properties of the nodes. This opens up an Edit and then that causes my IsModified = false at the end of the business analysis to be ignored.