Skip to content

feat(actors): Implement UnregisterActorRemindersByType for bulk reminder cleanup #790

@WhitWaldo

Description

@WhitWaldo

Summary

The Dapr runtime exposes an UnregisterActorRemindersByType RPC (defined in dapr.proto line 103) that unregisters all reminders for a given actor type, optionally scoped to a specific actor instance. The JS SDK does not currently implement this method.

Motivation

  • SDK parity: Other Dapr SDKs expose this capability.
  • Operational cleanup: Enables bulk removal of reminders during actor type deprecation, scaling events, or testing cleanup.
  • Reduced boilerplate: Without this, users must enumerate reminders via ListActorReminders and individually unregister each one.

Proto Definition

From src/proto/dapr/proto/runtime/v1/actors.proto:

// UnregisterActorRemindersByTypeRequest is the message to unregister an actor
// reminders by the given type. Optional actor_id can be provided to limit the
// scope of the operation to a specific actor instance.
message UnregisterActorRemindersByTypeRequest {
  string actor_type = 1;
  optional string actor_id = 2;
}

message UnregisterActorRemindersByTypeResponse {}

Proposed API Surface

// IClientActor interface addition:
unregisterActorRemindersByType(actorType: string, actorId?: ActorId): Promise<void>;

Implementation Notes

  • gRPC path: Call UnregisterActorRemindersByType on the Dapr service via ConnectRPC client.
  • HTTP path: DELETE /v1.0/actors/{actorType}/reminders (with optional ?actorId= query param — verify against Dapr runtime HTTP API).
  • The actor_id parameter is optional. When provided, only reminders for that specific actor instance are removed. When omitted, all reminders for the entire actor type are removed — this should be clearly documented as a potentially destructive operation.

Acceptance Criteria

  • unregisterActorRemindersByType added to IClientActor interface
  • gRPC implementation
  • HTTP implementation
  • Unit tests
  • E2E tests (register several reminders, bulk unregister, verify they're gone)
  • Clear JSDoc documentation warning about the destructive nature when actorId is omitted

References

Metadata

Metadata

Assignees

No one assigned
    No fields configured for Feature.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions