Skip to content

fix(workflows): coerce empty alias to null on clear#2543

Merged
daryllimyt merged 1 commit intoTracecatHQ:mainfrom
boyazhang314:fix/workflow-alias-empty-string
Apr 22, 2026
Merged

fix(workflows): coerce empty alias to null on clear#2543
daryllimyt merged 1 commit intoTracecatHQ:mainfrom
boyazhang314:fix/workflow-alias-empty-string

Conversation

@boyazhang314
Copy link
Copy Markdown
Contributor

@boyazhang314 boyazhang314 commented Apr 20, 2026

Checklist

  • Read CONTRIBUTING.md.
  • PR title is short and non-generic (see previously merged PRs for examples).
  • PR only implements a single feature or fixes a single bug.
  • Tests passing (uv run pytest tests)?
  • Lint / pre-commits passing (pre-commit run --all-files)?

Description

Clearing out the Alias field would send an empty string, which would violate the duplicate constraint. So the user cannot remove a workflow alias.

Set "" to null on the frontend and handle empty string on the backend.

Related Issues

Screenshots / Recordings

Steps to QA

  1. Create two workflows
  2. Add an alias to one of the workflows
  3. Removing the alias should work successfully

Summary by cubic

Fixes the bug where clearing a workflow alias sent an empty string and hit a unique constraint. Now empty or whitespace-only values are coerced to null so users can remove aliases safely. Also normalizes error_handler.

  • Bug Fixes
    • Frontend: alias input sends null when cleared.
    • Backend: WorkflowUpdate validator maps empty/whitespace strings to None for alias and error_handler, preventing uq_workflow_alias_workspace_id collisions.

Written for commit 84318d2. Summary will update on new commits.

Clearing a workflow alias sent "" to the API, which violated
uq_workflow_alias_workspace_id once more than one workflow had an
empty-string alias. Normalize empty/whitespace-only values to null
in WorkflowUpdate and in the alias input's onChange.
@zeropath-ai
Copy link
Copy Markdown

zeropath-ai Bot commented Apr 20, 2026

No security or compliance issues detected. Reviewed everything up to 84318d2.

Security Overview
Detected Code Changes
Change Type Relevant files
Enhancement ► workflow-panel.tsx
    Handle empty string input for workflow alias and error handler fields to be null
Bug Fix ► schemas.py
    Coerce empty strings to None for alias and error_handler fields in WorkflowUpdate schema

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 2 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

@topher-lo topher-lo added the fix Bug fix label Apr 20, 2026
@daryllimyt daryllimyt merged commit 586fc5f into TracecatHQ:main Apr 22, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants