8000 Fix creating temporary dashboard client on startup by JamesNK · Pull Request #6316 · dotnet/aspire · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix creating temporary dashboard client on startup #6316

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 21, 2024

Conversation

JamesNK
Copy link
Member
@JamesNK JamesNK commented Oct 15, 2024

Description

While testing I noticed that a dashboard client was created and then disposed in some middleware. This happened because the middleware wants to know if the client is enabled or not, so resolves the service.

However, because the client is a scoped service, a new instance is created and then later disposed. Once the dashboard UI is displayed another client is created.

The fix is to split the IsEnabled flag out into its own interface which is resolved to test if the client is enabled in middleware. It's ok to do because it has a singleton lifetime.

Low priority. Post 9.0.

Checklist

  • Is this feature complete?
    • Yes. Ready to ship.
    • No. Follow-up changes expected.
  • Are you including unit tests for the changes and scenario tests if relevant?
    • Yes
    • No
  • Did you add public API?
    • Yes
      • If yes, did you have an API Review for it?
        • Yes
        • No
      • Did you add <remarks /> and <code /> elements on your triple slash comments?
        • Yes
        • No
    • No
  • Does the change make any security assumptions or guarantees?
    • Yes
      • If yes, have you done a threat model and had a security review?
        • Yes
        • No
    • No
  • Does the change require an update in our Aspire docs?
    • Yes
      • Link to aspire-docs issue:
    • No
Microsoft Reviewers: Open in CodeFlow

@JamesNK JamesNK added area-dashboard NO-MERGE The PR is not ready for merge yet (see discussion for detailed reasons) labels Oct 15, 2024
@JamesNK JamesNK requested review from drewnoakes and adamint October 15, 2024 14:21
@JamesNK JamesNK force-pushed the jamesnk/dashboard-client-status branch from 566c504 to d9f62b5 Compare October 21, 2024 01:22
@JamesNK JamesNK removed the NO-MERGE The PR is not ready for merge yet (see discussion for detailed reasons) label Oct 21, 2024
Copy link
Member
@drewnoakes drewnoakes left a comment

Choose a reason for hiding this comment

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

Nice find and fix.

@JamesNK JamesNK merged commit 45898c6 into main Oct 21, 2024
9 checks passed
@JamesNK JamesNK deleted the jamesnk/dashboard-client-status branch October 21, 2024 13:17
@github-actions github-actions bot locked and limited conversation to collaborators Nov 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0