Skip to content

fix: add diagnostic warning when LoadingView Source is never set#1564

Merged
dr1rrb merged 4 commits intomainfrom
dev/dr/extSplashLogs
Apr 7, 2026
Merged

fix: add diagnostic warning when LoadingView Source is never set#1564
dr1rrb merged 4 commits intomainfrom
dev/dr/extSplashLogs

Conversation

@dr1rrb
Copy link
Copy Markdown
Member

@dr1rrb dr1rrb commented Apr 6, 2026

PR Type

What kind of change does this PR introduce?

  • Bugfix

What is the current behavior?

When LoadingView.Source is never set (stays null), the control remains in the Loading visual state indefinitely because Source?.IsExecuting ?? true evaluates to true. There is no diagnostic output to help developers identify why the view is stuck, making
black screen issues very difficult to troubleshoot.

What is the new behavior?

LoadingView.OnApplyTemplate() now schedules a deferred check: if Source is still null after 5 seconds, a Debug.WriteLine warning is emitted indicating the view will remain in Loading state indefinitely. The warning is a no-op in Release builds and does not
change any control flow or visual behavior.

New runtime tests validate LoadingView state transitions for null Source, Source becoming not-executing, and Source set after template application.

PR Checklist

Other information

Files changed:

  • LoadingView.cs — Deferred Debug.WriteLine diagnostic when Source stays null after template apply
  • LoadingViewTests.cs — New runtime tests for LoadingView state transitions

Copilot AI review requested due to automatic review settings April 6, 2026 18:56
@dr1rrb dr1rrb enabled auto-merge April 6, 2026 18:56
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a diagnostic warning to the LoadingView control that helps developers identify when the Source property is never set, which would cause the control to remain in the "Loading" visual state indefinitely. The diagnostic emits a Debug.WriteLine() message after 5 seconds if the Source remains null, providing actionable guidance without changing any functional behavior.

Changes:

  • Adds WarnIfSourceNeverSetAsync() method that schedules a deferred diagnostic warning 5 seconds after template application if Source is still null
  • Modifies OnApplyTemplate() to trigger the diagnostic check
  • Adds required using System.Threading.Tasks; import for async support

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@unodevops
Copy link
Copy Markdown
Contributor

⚠️⚠️ The build 205729 has failed on Uno Toolkit - CI.

@unodevops
Copy link
Copy Markdown
Contributor

⚠️⚠️ The build 205758 has failed on Uno Toolkit - CI.

@dr1rrb dr1rrb merged commit 69cab3d into main Apr 7, 2026
19 of 20 checks passed
@dr1rrb dr1rrb deleted the dev/dr/extSplashLogs branch April 7, 2026 14:23
@welcome
Copy link
Copy Markdown

welcome bot commented Apr 7, 2026

Congrats on your first pull-request! We ❤ the people who are involved in this project, and we’d love to pay it forward by sending you some swag. If you have any feedback (or ideas how to improve Uno as a open-source project) please open a feedback issue.
giphy
Merci beaucoup 👋

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.

4 participants