Skip to content

v0.6.0 — pub/sub routing + bulk, streaming crypto, error model

Choose a tag to compare

@sideeffffect sideeffffect released this 10 Oct 16:02
83561cc

Pub/sub routing and bulk subscribe, streaming crypto, and the error-model redesign. This release has breaking changes to the dapr-wasm-components:interfaces WIT package since v0.4.0. It includes the 0.5.0 changes, which had no GitHub release of their own.

Breaking

  • Error model redesign (0.5.0). There is no longer one shared 7-case error variant.
    • Each interface now has its own variants for errors you can recover from, sometimes per function. Example: state.save → write-error { etag-mismatch, … }.
    • A missing value is now an error case such as key-not-found. It is no longer option in the success type.
    • Infrastructure failures, such as the sidecar being down, a 5xx or a timeout, now trap instead of being typed.
    • Inbound callbacks use types.app-error.
  • topic-subscription has new fields. If you build the record literally, add routes: none, bulk-subscribe: none. You can also use the new dapr-app builder: TopicSubscription::new(pubsub, topic).
  • New export pubsub-callback.on-bulk-topic-event. Apps built on the dapr-app SDK get a default implementation. Apps that implement the WIT directly must add it.

New

  • Pub/sub CEL routing rules. topic-subscription.routes { rules: [{match, path}], default }. daprd evaluates the rules, and the matched route arrives in topic-event.path. SDK: .with_rule(cel, path).with_default_route(path).
  • Pub/sub bulk subscribe.
    • Turn it on with .with_bulk_subscribe(max_count, max_await_ms). Batches arrive at on-bulk-topic-event, with a status for each entry (SUCCESS / RETRY / DROP).
    • The SDK default passes each entry to on_topic_event.
    • You can use it together with routing rules.
    • gRPC inbound serves OnBulkTopicEvent and the older OnBulkTopicEventAlpha1.
  • Streaming crypto with sync WIT resources (no WASI 0.3).
    • Use encryptor / decryptor: write the input in chunks, call finish, then read the output in chunks from crypto-output. The SDK wraps these as std::io types in dapr_app::crypto_io.
    • wasi-http-outbound streams both HTTP bodies. daprd v1.18 still buffers the output and limits the input to --max-body-size (default 4Mi).
    • wasi-grpc-outbound buffers the data in provider memory, and payloads over 4Mi work.

Fixes

  • Secrets. A missing secret now returns secret-not-found on both providers. Before, it trapped against a real daprd, because daprd reports a missing secret as ERR_SECRET_GET.
  • Crypto. "Component not found" now maps to component-not-found.

Findings (documented, no API change)

  • Input-binding reply. daprd ignores the input-binding reply. On the HTTP app channel it ignores the reply completely. On the gRPC channel it uses only to/data/concurrency. The E2E records this behaviour, so we will notice if daprd changes it.
  • Workflow. Only the HTTP workflow API is deprecated. The gRPC provider uses the *WorkflowBeta1 RPCs, which are not deprecated.
  • Actor hosting with gRPC outbound. Compose --out grpc --in http and run daprd with --app-protocol http.

Tooling

  • wasmtime 49, wit-bindgen 0.62, wac-graph 0.12
  • CI runs Spin v4.2.2, wkg 0.16.1 and daprd 1.18.7

Full changelog: v0.4.0...v0.6.0