Skip to content

docs(platform): state the loop reply rule on dispatchFlowID - #467

Open
sandunip-govtech wants to merge 1 commit into
OpenNSW:mainfrom
sandunip-govtech:docs/dispatch-flow-id-loop-rule
Open

sandunip-govtech wants to merge 1 commit into
OpenNSW:mainfrom
sandunip-govtech:docs/dispatch-flow-id-loop-rule

Conversation

@sandunip-govtech

Copy link
Copy Markdown
Contributor

Summary

The comment on dispatchFlowID describes a step that runs again in a loop as if dispatching again were harmless: "a second dispatch of the same workflow from the same task names the flow already started". It isn't. A step that runs again has a new callbackToken, but the other side returns the flow it already started, still holding the first token. Its decision then reaches a step that is no longer waiting, gets 409, and the re-run step never completes. The comment now states this as a rule: a loop step must reply on the other side's token.

The same wording was fixed in nsw-srilanka's docs/WORKFLOW_GUIDE.md in the review of OpenNSW/nsw-srilanka#1323.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactoring (no functional changes)
  • Performance improvement
  • Other (please describe):

Changes Made

  • platform/tasktypes/external_review.go: the dispatchFlowID comment says that a step that runs again in a loop must reply on the other side's token rather than dispatch again, and why. No code changes.

Testing

  • I have tested this change locally
  • I have added tests that prove my fix is effective or that my feature works
  • I have tested edge cases
  • All existing tests pass

Comment only. go test ./tasktypes/ and go vet pass in platform.

Checklist

  • My code follows the project's style guidelines
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have checked that there are no merge conflicts

Related Issues

Related to OpenNSW/nsw-srilanka#1316. Follow-up to #466.

Screenshots/Demo

N/A

Additional Notes

None.

A step that runs again in a loop must reply on the other side's token: a
second dispatch names the flow already started, which keeps the first
token, so the step would never complete.
@coderabbitai

coderabbitai Bot commented Dec 4, 2026

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: d8e9a92e-f475-4715-baac-79ec9f21789f
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

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.

2 participants