Data UI Backlog

Fix bidirectional M2M

List fields on both ends of the same joiner compile but stack-overflow at runtime on /api/list.

Example: books have :authors (M2M) and authors have :books (M2M) on the same joiner. Then:

be-list(:books)
  → allowed-values → authors list field
    → be-list-column(:authors …) → be-list(:authors)
      → allowed-values → books list field
        → be-list(:books)   ; infinite mutual recursion

Empty tables still hit this: be-list always builds allowed-values via list-result. The request never completes, so the frontend never gets create: true and the Add button never appears (symptom of the failed list, not a separate create-flag bug).

Root cause: allowed-values-for-field calls full be-list / be-list-column on the related type. There is no cycle break. (Also still uses :source, not :source-all — see separate todo; that alone does not fix the recursion.)

****Goal:**** make bidirectional M2M work. Allowed-values for a list field must load option rows without re-entering the full be-list → allowed-values path on the other type (e.g. a narrow options query / be-list-column path that skips nested allowed-values, or an explicit recursion guard that still returns usable options).

****Not the goal:**** a compile-time reject of two-sided list fields. Docs currently say "one-way M2M only" and known gap 11; those should flip to supported once fixed.

****Related****

****Workaround today:**** one-directional M2M only (owner has the list field; other side does not). Base model follows that (users→roles, not both ways).

****Impress-MVP note:**** not on the demo path (Model Bank / todos / books are one-way). Reputation footgun for AI-authored models; prefer a cheap guard if generator ships before full fix.

Fix:

Commit: 39e37e6 Fix bidirectional M2M

Slot
24700
Status
60 Done
Tags
mvp, backend, compiler, bug
Contributors
Donnie