daw_event/v1, daw_event_response/v1: typed answer field and receiver rules #19
Labels
No labels
coordination/cross-repo
coordination/needed
effort
large
effort
medium
effort
small
meta/duplicate
meta/planning
meta/wontfix
priority
high
priority
low
priority
medium
session
blocker
session
handover
session
next
status
blocked
status
done
status
in-progress
status
review
status
to-go
type
admin
type
bug
type
config
type
deployment
type/design
type
docs
type
enhancement
type
feature
type
handover
type
infrastructure
type
installation
type
maintenance
type
migration
type
research
type
security
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
DAW/daw-contracts#19
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The first real use of
decision_required(module removal confirmation,DAW/daw-module-manager) showed two gaps that every later use will hit:
daw_field_type/v1) has noplace in
daw_event/v1. The code puts it intodata.answer, next tothe values of the message placeholders. That is a convention, not a
contract, and
answercan collide with a placeholder name. Theresponse value sits in
data.value, also only by convention.daw_event_response/v1says whatevent_idandoperation_idmean,but not who checks them and what happens with an unexpected, repeated
or incomplete response. In the removal flow a response was accepted
without
event_idandsource, because the module cannot know theevent_idof an event it sent in an earlier call.Changing this is cheap now and expensive once several programs use it.
Proposal (to discuss)
A. A typed field for the answer in
daw_event/v1answeron the event itself, adaw_field_type/v1object (name to be confirmed in the discussion)
object of another contract is a typed field, never an untyped value
inside
datatype = decision_required; adecision_requiredwithout it stays valid (the form of the answer isthen defined per
code, as today)datakeeps its role: domain data and placeholder valuesB. The answer in
daw_event_response/v1answer,data.valuehas the form that fielddeclares (single: one value, multiple: a list of values); otherwise the
form is defined per event
code, as todayC. Receiver rules for responses
Whoever holds the pending event checks the response (the pattern of the
receiver contract in
mainjan/v1):event_idmust name a pending event,operation_idmust match it,sourcemust be presentand a response for an unknown event are rejected
remember the event; the holder (the host) has checked it
Not in this issue
collection.valuesentries (DAW/daw-contracts#17)mainjan)Acceptance criteria
daw_event/v1anddaw_event_response/v1updated, changelog entriescases (unknown event, wrong
operation_id, repeated response)Related
DAW/daw-contracts#17, DAW/daw-contracts#18,
DAW/daw-modul-berhtjan-core (pending decisions registry, companion issue),
DAW/daw-module-manager (companion issue),
DAW/daw-modul-berhtjan-cli#15
Implemented on main
Commits:
6e1838fPushed. Follow-up points, if any, are tracked in their own issues.