Skip to content

forms: FlowSession::set<>'s @brief promises handler forwarding and in-flight coalescing that its own body says do not happen #417

Description

@Yaraslaut

Found while fixing morph#355, and reported to the sprint manager rather than
absorbed into that ticket. Both defects are in one doc block, so they are one
ticket: splitting them would put two branches on the same lines.

1. The @brief promises behaviour the body denies

FlowSession::set<>'s published @brief (include/morph/forms/flows.hpp:239-241):

Sets one field of the current step's draft and forwards it to the handler's
ordinary set<>
(auto-fires when the step's ActionValidator is ready,
exactly as a standalone form).

The body, eleven lines below, says the opposite in its own comment
(flows.hpp:262-266):

The readiness gate that used to live in the handler's draft machinery lives
here now
: the flow already owns the draft, so it can decide when the step is
complete and dispatch it itself. Note there is no in-flight coalescing
each ready set<> dispatches, where the old handler-side draft collapsed
patches landing during a flight.

Two claims in the @brief are false:

  • "forwards it to the handler's ordinary set<>" — it does not forward
    anywhere. flows.hpp:256-270 writes std::get<A>(_drafts), checks
    ActionValidator<A>::ready(draft) itself, and calls its own fireStep<A>.
  • "exactly as a standalone form" — the body names the exact way it is not:
    a standalone form's handler-side draft coalesced patches arriving during a
    flight; this does not.

The coalescing one is what makes this worth a ticket rather than tidying. A
caller reading the published documentation will expect keystroke-rate set<>
calls to collapse into one dispatch while a request is in flight. They do not —
each ready set<> dispatches. That is a difference in request volume and in
observable ordering, promised by the docs and not delivered.

2. BridgeHandler::set<> does not exist

The same block cites it twice — flows.hpp:184 and the @brief at :239:

the reactive draft/subscription primitive (BridgeHandler::set<> /
subscribe<>, bridge.hpp)

BridgeHandler has no set<> member. Its only set-like members are
setDefaultSession, setException, setExecuteDeadline, setPrincipal,
setReconnectHandler, setSession and setValue — verified by
grep -oE '\bset[A-Z][A-Za-z]*' include/morph/core/bridge.hpp | sort -u.

This is the same defect class as morph#355 and morph#349, under a different
name, so neither of their fixes touches it. Sibling sites outside this file are
tracked separately (registry.hpp and examples/bank) — see the issue filed
alongside this one.

Verification status: reproduced

Read on master e675253a. flows.hpp:239-241 and :262-270 quoted verbatim
above; the BridgeHandler member list is from the grep named above. The
contradiction is visible in a single 35-line span of one file.

Not verified: whether any caller currently depends on the coalescing the
@brief promises. If one does, this stops being a documentation defect and
becomes a behavioural one, which is a different and larger ticket.

What would close this

  1. The @brief describes what FlowSession::set<> does: owns the draft,
    evaluates readiness itself, dispatches via fireStep<A>, and does not
    coalesce in flight
    . The absence of coalescing is stated in the published
    documentation, not only in an implementation comment.
  2. Both BridgeHandler::set<> citations name something that exists, repointed
    rather than deleted so the explanation they carry survives — the standard
    morph#355 applied.
  3. git grep "BridgeHandler::set<>" returns nothing in
    include/morph/forms/.

Blocked by morph#355 — its PR #414 edits flows.hpp:184-191, the same doc
block.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: formsSubsystem: formsbugSomething isn't workingtriage: validWell-framed; implement as written

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions