Skip to content

Inbound CloudEvent topic/pubsubname (and JobName) fed into non-empty require can throw mid-dispatch #35

Description

@sideeffffect

Severity: low · Category: correctness (robustness)

Evidence

  • src/internal/DaprAppServer.scala:539-540Topic(s.asText("")) / PubSubName(s.asText("")) lack the .filter(_.nonEmpty) guard that every sibling field has (:531,533,535,538,541).
  • src/internal/JobsCapabilityImpl.scala:48JobName(resp.getName.nn) feeds a sidecar-supplied name straight into a non-empty constructor.

Problem
Topic/PubSubName/JobName require(nonEmpty). A present-but-empty value ("") in the envelope throws IllegalArgumentException inside the handler → 500 / RETRY instead of graceful handling. Defensive (the sidecar normally populates these), but it's an in-block asymmetry with the other fields.

Suggested fix
Mirror the sibling fields: Option(env.get("topic")).map(_.asText("")).filter(_.nonEmpty).map(Topic(_)).getOrElse(default) (same for pubsubname); only wrap JobName when non-empty.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinglowLow importance

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions