Tell pre-resume extensions when a call is a draft save

Open
#327 0 comments 0 reactions 1 assignee View on GitHub

Maintainers usually reply within 1 day

@chathura-de-silva is already working on this.

Since Oct 21, 2026.

Assessment

This issue has not been assessed yet.

Description

Priority/Normal Type/Improvement
Current Limitation

Extensions are generic, but PRE_RESUME extensions can't tell a draft save from a submission unless the host marks it for them. SaveDraft only sets __command to the step's draft command, and that can't be the signal: a normal submission through CompleteTaskStep can name the same command. A host that marks drafts itself (as nsw-srilanka's draft handler does for its payload schema extension) ties that extension to the host instead of to core.

Suggested Improvement

SaveDraft tags the context it passes to the pre-resume extensions, for example with extensions.WithDraft(ctx), and extensions check extensions.IsDraft(ctx). CompleteTaskStep never sets it, so an extension can rely on it whatever command the payload names.

Version

b3521096e55b

Additional Context

This was raised in the review of OpenNSW/nsw-srilanka#821. Once this is released, nsw-srilanka's payload schema extension will switch to extensions.IsDraft, and the handler's marker will be removed. The read-only and undeclared-field checks (OpenNSW/nsw-srilanka#795, OpenNSW/nsw-srilanka#796) need the same signal.

Dominant language
Go
Stars
6
Forks
8
Avg merge
21h 36m
Merged PRs (30d)
42

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from OpenNSW/core

All issues in OpenNSW/core

Similar issues

More Go issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.