ErrorsExternal services · rule
connection.domain_not_listed
An action calls an outside service through a connection whose domains: list doesn't include the action's domain.
Area 11, External services; not declinable; the next step is usually the human's.
Why Jadpo refuses it
Each connection in app.jadpo lists the domains whose actions may call
it, such as domains: [shipping] for a courier's API. A new caller then
shows in review as a one-line change to that list. Other domains reach
the service through the listed domain's public actions, so the code that
talks to it stays in one place.
Jadpo won't add the domain for you. The list decides which parts of your app may use an outside service, and so what a change to one domain can reach.
What it looks like
app.jadpo:
application { connections: { couriers: { package: AcmeCouriers.v1 domains: [shipping] environment: config.couriers_environment } }}
The support domain calls the connection directly.
domains/support/actions/track_parcel.jadpo:
use app { couriers }use shared/providers/acme_couriers/// Where a customer's parcel is.action track_parcel(lookup: AcmeCouriers.ParcelLookup) -> AcmeCouriers.Parcel { return couriers.parcels.get(lookup)}
error support calls couriers, whose domains: doesn't list it
--> domains/support/actions/track_parcel.jadpo:6:12
|6 | return couriers.parcels.get(lookup) | ^^^^^^^^^^^^^^^^^^^^ not a listed domain
- reason
- A connection lists the domains whose actions may call it, so a new caller is a one-line change a reviewer sees;
courierslistsshipping, and other domains go through their public actions. - next
- Add
supporttocouriers'sdomains:inapp.jadpo, or call one ofshipping's public actions instead (human) - rule
- connection.
domain_ not_ listed - help
- https://jadpo.
dev/docs/errors/connection. domain_ not_ listed
(human) at the end of the next: line tells your coding agent to stop
and ask you which fix you want, because the choice is yours to make: it
decides which domains may call the courier's API.
How to fix it
The question is whether support should talk to the courier itself.
If it should, add support to the connection's domains: in
app.jadpo:
domains: [shipping, support]support's actions may now call couriers directly, and the change shows
in review as a new caller.
If it should go through shipping, give shipping a public action
that makes the call. domains/shipping/actions/locate_parcel.jadpo:
use app { couriers }use shared/providers/acme_couriers/// Where a customer's parcel is, for other domains to ask.public action locate_parcel(lookup: AcmeCouriers.ParcelLookup) -> AcmeCouriers.Parcel { return couriers.parcels.get(lookup)}
Then support calls that action, with use shipping in place of
use app { couriers }. In domains/support/actions/track_parcel.jadpo:
use shipping return shipping.locate_parcel(lookup)
Only shipping calls the courier, and support asks shipping where a
parcel is.
Related
Markdown for agents: /docs/errors/connection.domain_not_listed.md.Built from Jadpo main at aee2e8f.