Skip to content

Conversation

@SuperJMN
Copy link
Contributor

@SuperJMN SuperJMN commented Oct 22, 2025

Improve stability when the previewer process crashes or cannot be started

Comment on lines 135 to 136
@Volatile
private var lastProjectFilePath: Path? = null
Copy link
Owner

Choose a reason for hiding this comment

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

Could you please explain why is this field needed? Normally the project file path is immutable, it's set once and never changes (unless the project is renamed, or something? Are you targeting such cases?).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense; that field is gone now and we read the current projectFilePath directly from the property whenever we need it (e.g., when scheduling restarts), so there is no redundant state to keep in sync.

@ForNeVeR

This comment was marked as resolved.

@ForNeVeR

This comment was marked as resolved.

@ForNeVeR ForNeVeR removed their assignment Nov 19, 2025
@SuperJMN SuperJMN force-pushed the pr/improve-previewer branch 2 times, most recently from 783564d to 88276bd Compare December 22, 2025 16:06
@SuperJMN
Copy link
Contributor Author

Hi @ForNeVeR! I've addressed the compilation error (missing type parameter on runReadAction). The CI should pass now.

Side note: I noticed there's some pre-existing code duplication between getProjectContainingFile in AvaloniaPreviewerSessionController.kt (line 185) and the extension function in ProjectModelNodeEx.kt (line 31). Both functions do essentially the same thing. This duplication predates this PR, so I left it as-is, but it could be a good candidate for a future cleanup - the controller could simply use xamlFile.getProjectContainingFile(controllerLifetime, project) instead of having its own private copy.

@ForNeVeR

This comment was marked as resolved.

@ForNeVeR ForNeVeR assigned ForNeVeR and unassigned SuperJMN Dec 22, 2025
@SuperJMN SuperJMN force-pushed the pr/improve-previewer branch 3 times, most recently from 756eec1 to bb3c6f3 Compare December 22, 2025 20:34
@SuperJMN
Copy link
Contributor Author

SuperJMN commented Dec 22, 2025

CI update: Windows and Ubuntu are now passing

The macOS failure is unrelated to code changes - it's caused by a NuGet infrastructure issue:

Unable to resolve 'Avalonia (>= 11.3.10)' for 'net8.0'.

A re-run should fix it.

@ForNeVeR ForNeVeR force-pushed the pr/improve-previewer branch from bb3c6f3 to c043619 Compare January 24, 2026 13:53
@ForNeVeR ForNeVeR force-pushed the pr/improve-previewer branch from 1833c84 to 1660228 Compare January 24, 2026 14:28
Copy link
Owner

@ForNeVeR ForNeVeR left a comment

Choose a reason for hiding this comment

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

Thanks!

@ForNeVeR ForNeVeR merged commit 1660228 into ForNeVeR:main Jan 24, 2026
6 checks passed
@SuperJMN SuperJMN deleted the pr/improve-previewer branch January 27, 2026 15:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants