Issues with Session Expired/ Document Corrupted on WOPI collaborative document when i provide comments, save and re open

Mohana Pulugurtha 0 Reputation points
2025-08-07T14:11:00.71+00:00

So i have a collaborative document on wopi cloud and when i give comments and save the timestamp is getting altered and i see the below error as in image 2. The document data is read using MemoryStream and there is no other logic around comments or its timestamp. I tried to manually tweak in Putfile Request using logic around WordprocessingCommentsPart and Comment but see no luck. Please help me resolve this blocking issue.

Also, note this issue doesn't occur when there are no comments. The document content saves perfectly fine and shows up even on re open.User's image

User's image

Microsoft 365 and Office | Word | For business | Android

Locked Question. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

3 answers

Sort by: Most helpful
  1. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  2. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  3. Anonymous
    2025-08-08T01:30:32.28+00:00

    Hi @Mohana Pulugurtha

    Thank you for reaching out to Microsoft Q&A Forum. 

    It sounds like the "Session Expired" error after saving comments through WOPI might be related to how the comment timestamps are being handled in the document. 

    From what you've described, the original comment was added at 7:03 PM, but after saving and reopening the document, the timestamp appears to have shifted to 12:03 PM. This kind of discrepancy can sometimes cause Office Online to invalidate the editing session, especially if the timestamp format or timezone is inconsistent with what the WOPI host or Office expects. 

    Here are a few things you might want to review: 

    -Make sure the comment timestamps are in valid ISO format (yyyy-MM-ddTHH:mm:ssZ) and ideally in UTC. 

    -Confirm that the WordprocessingCommentsPart is being written correctly when saving the document. Missing or malformed comment metadata (like author, date, or id) can cause Word to treat the document as corrupted. 

    -Compare the document content before and after the PutFile call to see if the timestamp or comment structure is being altered unexpectedly. 

    -Review the CheckFileInfo response to ensure fields like LastModifiedTime and UserCanWrite are being updated properly. 

    If the issue only occurs when comments are present, it’s likely tied to how that part of the document is being handled during the save operation. 

    I hope this helps. Please let me know if you get a chance to try them out.


    If the answer is partially helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".      

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    Was this answer helpful?