Repository navigation
Commit before consolidating when saving a message with removed attachments - #550
Merged
Sicos1977 merged 1 commit intoNov 16, 2026
Conversation
…ments Since OpenMcdf 3.4.0, Flush(true) throws 'Commit or revert the changes to a transacted storage before consolidating it' when changes are pending. UpdateMessagePropertiesAfterAttachmentDeletion writes the properties stream after the last Commit, so Save() threw for every message with deleted attachments. Commit those changes first.
|
Is there a plan to release a nuget package containing this fix? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Removing an attachment and saving the message fails in 6.2.1:
This started with the OpenMcdf 3.3.0 -> 3.4.0 update (11c4c02): 3.4.0 refuses to consolidate while changes are pending. In
Save(),UpdateMessagePropertiesAfterAttachmentDeletionwrites the properties stream after the lastCommit(), and thenFlush(true)consolidates. Committing those changes first fixes it.Four of the existing tests cover this and fail on master with the exception above (
MessageSizeProperty_UpdatedWhenExists,AttachmentsRemovedSuccessfully,RemoveAttachments,RemoveAttachmentsReducesFileSize). The workflow currently stops at "Restore dependencies", so they haven't run in CI since the update. With this change,dotnet test MsgReaderTests -f net10.0: 75 passed, 0 failed (before: 72 passed, 4 failed).MessageSizeProperty_UpdatedWhenExistsnow reaches its ownInconclusivebranch, because the sample file has noPR_MESSAGE_SIZE.