Skip to content

fix: make workflow recycling queries nil-safe - #676

Open
LordofAvernus wants to merge 1 commit into
mainfrom
dms/fix-997
Open

LordofAvernus wants to merge 1 commit into
mainfrom
dms/fix-997

Conversation

@LordofAvernus

@LordofAvernus LordofAvernus commented Oct 26, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

Workflow conversion assumes WorkflowRecord is always preloaded. Callers that intentionally query workflows without associations can therefore panic while reading task IDs. The daily EE recycle job also needs a lightweight way to obtain expired workflow identifiers without converting complete workflow models.

Summary

  • make Workflow.GetTaskIds return safely when the workflow record is not loaded
  • add a repository query that selects only workflow UIDs older than a supplied cutoff
  • cover nil association handling and expired UID selection

Test plan

  • go test -vet=off ./internal/dms/storage/model ./internal/dms/storage -run 'TestWorkflowGetTaskIds|TestListExpiredWorkflowUIDs' -count=1
  • go vet -printf=false ./internal/dms/storage/model ./internal/dms/storage ./internal/dms/biz

Refs actiontech/dms-ee#997

@github-actions

Copy link
Copy Markdown

PR Reviewer Guide 🔍

⏱️ Estimated effort to review: 1 🔵⚪⚪⚪⚪
🧪 PR contains tests
🔒 No security concerns identified
⚡ No major issues detected

@github-actions

Copy link
Copy Markdown

PR Code Suggestions ✨

No code suggestions found for the PR.

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.

1 participant