Skip to content

Rejecting the blank task queue names in WorkerFactory.newWorker() - #3031

Open
ad-kat wants to merge 1 commit into
temporalio:mainfrom
ad-kat:oc-for-blank-taskqueue-validation
Open

Rejecting the blank task queue names in WorkerFactory.newWorker()#3031
ad-kat wants to merge 1 commit into
temporalio:mainfrom
ad-kat:oc-for-blank-taskqueue-validation

Conversation

@ad-kat

@ad-kat ad-kat commented Aug 23, 2026

Copy link
Copy Markdown

Checklist

  1. Closes

  2. How was this tested:

  1. Any docs updates needed?

What was changed

WorkerFactory.newWorker() will now reject blank/whitespace-only task queue names (e.g. " ") in addition to null and empty strings. The error message was updated from "should not be an empty string" to "should not be an empty or blank string" to reflect this. A new test class WorkerFactoryValidationTest covers null, empty, and blank task queue rejection using TestWorkflowEnvironment.

Why?

Strings.isNullOrEmpty(" ") returns false, so whitespace-only task queue names silently passed validation and were forwarded to the Temporal server, producing a cryptic server-side error instead of a clear, early IllegalArgumentException at the call site.

This aligns WorkerFactory with the validation pattern already used elsewhere in this codebase. StartNexusOperationOptions.setId() uses trim().isEmpty() for the same reason.

Checklist

  1. Closes WorkerFactory.newWorker() accepts blank/whitespace-only task queue names #3030
  2. How was this tested: Added WorkerFactoryValidationTest with three unit tests covering null, empty, and blank task queue names. All pass locally using TestWorkflowEnvironment (no external service required).
  3. Any docs updates needed? No.

@ad-kat
ad-kat requested a review from a team as a code owner August 23, 2026 22:29
@CLAassistant

CLAassistant commented Aug 23, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

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.

WorkerFactory.newWorker() accepts blank/whitespace-only task queue names

2 participants