Skip to content

Conversation

@seer-by-sentry
Copy link
Contributor

@seer-by-sentry seer-by-sentry bot commented Nov 4, 2025

Resolved / Related Issues

To prevent extra work, all changes to the Files codebase must link to an approved issue marked as Ready to build. Please insert the issue number following the hashtag with the issue number that this Pull Request resolves.

Steps used to test these changes

Stability is a top priority for Files and all changes are required to go through testing before being merged into the repo. Please include a list of steps that you used to test this PR.

  1. Verified that the RichTextPreview control now disposes of the stream associated with it when unloaded.
  2. Confirmed that the document content in the RichTextPreview is cleared when the control is unloaded.
  3. Tested the defensive check to ensure that loading is prevented if the stream is null or disposed.
  4. Verified fix generated by Seer in Sentry, triggered by Yair. 👁️ Run ID: 2416057. Click here to continue debugging with Seer.

@yaira2 yaira2 requested a review from hishitetsu November 4, 2025 19:58
@yaira2 yaira2 added the ready for review Pull requests that are ready for review label Nov 4, 2025
@yaira2 yaira2 changed the title Fix: Disposing stream and clearing document on RichTextPreview unload Fix: Dispose stream and clear document on RichTextPreview unload Nov 4, 2025
@hishitetsu
Copy link
Member

I plan to verify this carefully when I have time, but at first glance, I don't think this fix will resolve the issue.

Copy link
Member

@hishitetsu hishitetsu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if this will resolve the issue. Rather than that, I think it's better to simply catch the EndOfStreamException to avoid crashes.

@yaira2
Copy link
Member

yaira2 commented Nov 6, 2025

Where can we catch the EndOfStreamException?

@hishitetsu
Copy link
Member

Where can we catch the EndOfStreamException?

In TextPreviewControl_Loaded.

@yaira2
Copy link
Member

yaira2 commented Nov 6, 2025

@hishitetsu thank you for your help. I pushed this change to main.

@yaira2 yaira2 closed this Nov 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ready for review Pull requests that are ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants