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

Aperta
#327 0 commenti 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@chathura-de-silva ci sta già lavorando.

Dal 21/10/2026.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

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.

Lingua principale
Go
Stelle
6
Fork
8
Merge medio
21h 36m
PR unite (30g)
42

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di OpenNSW/core

Tutte le issue di OpenNSW/core

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.