Skip to content

Conversation

@gabynevada
Copy link
Contributor

@gabynevada gabynevada commented Aug 26, 2025

Summary

  • Implements IResourceWithWaitSupport interface for IDaprSidecarResource
  • Adds comprehensive test coverage for WaitFor functionality
  • Enables proper service startup sequencing for Dapr sidecars

Description

This PR addresses the issue where Dapr sidecars start immediately while dependent services (like Redis for pubsub) are still starting, causing component loading failures.

By implementing IResourceWithWaitSupport, Dapr sidecars can now properly wait for their dependencies to be ready before starting, ensuring reliable application startup.

Changes

  • Modified IDaprSidecarResource to implement IResourceWithWaitSupport
  • Added test case to verify WaitFor functionality works correctly with Dapr sidecars

Test Plan

  • Added unit test DaprSidecarSupportsWaitFor() to verify the implementation
  • Test verifies that IDaprSidecarResource implements IResourceWithWaitSupport
  • Test confirms WaitFor annotations are properly applied

Fixes #604

Implements IResourceWithWaitSupport for IDaprSidecarResource to enable proper
service startup sequencing. This allows Dapr sidecars to wait for dependent
services (like Redis for pubsub) to be ready before starting, preventing
component loading failures during application startup.

Fixes CommunityToolkit#604

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Copilot AI review requested due to automatic review settings August 26, 2025 00:16
Copy link
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 implements WaitFor support for Dapr sidecar resources to enable proper service startup sequencing. The change addresses an issue where Dapr sidecars would start immediately while their dependencies (like Redis for pubsub) were still starting, causing component loading failures.

  • Adds IResourceWithWaitSupport interface to IDaprSidecarResource
  • Includes comprehensive test coverage to verify WaitFor functionality works correctly

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/Shared/Dapr/Core/IDaprSidecarResource.cs Extends interface to implement IResourceWithWaitSupport for dependency management
tests/CommunityToolkit.Aspire.Hosting.Dapr.Tests/WithDaprSidecarTests.cs Adds test case to verify WaitFor functionality implementation

@gabynevada
Copy link
Contributor Author

Closing in favor of #810

@gabynevada gabynevada closed this Aug 26, 2025
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.

Dapr sidecar WaitFor

2 participants