Skip to content
Playground(another site)

bynk.actor.missing_by_on_call

Error An on call handler lacks the required by actor clause.

An on call handler is reachable by every context that consumes this one, and which of them may call it is an access decision, so the handler must say, with a by clause. by Caller is the explicit "any consuming context"; a refinement over Caller, a Foreign actor or a sum narrows it. The error's fix inserts by Caller, which is what the handler did before the clause was required, and bynk check --fix=bynk.actor.missing_by_on_call migrates a whole project. A header default, service pay by Caller, covers every handler without its own by. Agents, cron, queue and Events handlers have no caller to name, so they are unchanged.

Example

context shop
service authorise {
on call(total: Int) -> Effect[Int] { // ✗ who may call this?
total
}
}
service authorise {
on call(total: Int) -> Effect[Int] by Caller { // ✓ any consuming context, said outright
total
}
}

See also

  • Every code in its category, Actors, on the diagnostic index.
  • bynk explain bynk.actor.missing_by_on_call shows the same from the installed toolchain, without a network.