dapr / dapr/js-sdk

feat(pubsub): Promote BulkPublishEventAlpha1 to stable BulkPublishEvent

Open
#786 0 comments 0 reactions 0 assignees View on GitHub
area/pubsub enhancement good first issue sdk-parity
Dominant language
JavaScript
Stars
217
Forks
104
PR merge metrics
No merged PRs in 30d

Description

## Summary

The Dapr runtime has promoted the `BulkPublishEventAlpha1` RPC to the stable `BulkPublishEvent` endpoint. The JS SDK still targets the alpha1 variant in both its gRPC and HTTP implementations. We need to migrate to the stable API while maintaining backward compatibility during a deprecation period.

## Current State

The SDK currently uses the alpha1 endpoints:
- **gRPC client** (`src/implementation/Client/GRPCClient/pubsub.ts`): calls `client.bulkPublishEventAlpha1(...)` via ConnectRPC
- **HTTP client** (`src/implementation/Client/HTTPClient/pubsub.ts`): hits the `v1.0-alpha1/publish/bulk/{pubSubName}/{topic}` endpoint
- **Proto definition** (`src/proto/dapr/proto/runtime/v1/dapr.proto`): defines both `BulkPublishEventAlpha1` (alpha) and `BulkPublishEvent` (stable)
- **ConnectRPC stubs** (`src/proto/dapr/proto/runtime/v1/dapr_connect.js`): only exposes `bulkPublishEventAlpha1`

The stable `BulkPublishEvent` RPC is already defined in the proto but is not yet wired up in the ConnectRPC service definition or called from the SDK.

## Proposed Changes

1. **Regenerate / update ConnectRPC stubs** to include the stable `bulkPublishEvent` method in the `Dapr` service definition.
2. **Update gRPC client** (`src/implementation/Client/GRPCClient/pubsub.ts`):
- Change `client.bulkPublishEventAlpha1(...)` → `client.bulkPublishEvent(...)`
3. **Update HTTP client** (`src/implementation/Client/HTTPClient/pubsub.ts`):
- Change API version from `v1.0-alpha1` to `v1.0`
- Keep path as `/publish/bulk/{pubSubName}/{topic}`
4. **Public API surface** (`IClientPubSub.publishBulk()`): no signature change needed — the method name and types remain the same for consumers.
5. **Deprecation notice**: If we want to support older Dapr runtimes that only have the alpha1 endpoint, consider a fallback or a minimum-Dapr-version note in the docs.
6. **Update tests**: Ensure E2E tests exercise the stable endpoint (requires Dapr runtime ≥ the version that promoted BulkPublishEvent to stable).

## Acceptance Criteria

- [ ] `client.pubsub.publishBulk(...)` calls the stable `BulkPublishEvent` gRPC RPC
- [ ] HTTP client uses `v1.0/publish/bulk/...` instead of `v1.0-alpha1/publish/bulk/...`
- [ ] ConnectRPC generated stubs include `bulkPublishEvent`
- [ ] Existing unit and E2E tests pass
- [ ] Documentation updated to reflect stable API usage
- [ ] CHANGELOG entry noting the promotion from alpha1 to stable

## References

- Proto: `src/proto/dapr/proto/runtime/v1/dapr.proto` lines 71-76
- Dapr runtime promotion: https://github.com/dapr/dapr/issues/6582

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.