Duolith docs

Errors E0400 to E0499

E0433 Bridge call off its contract

Message where breaks the bridge's contract: problem

Words in italics are filled in when the compiler reports it, such as the element's name or the list of known ones.

Why

The app's TypeScript and the iOS and Android shells talk through one bridge, and spec/effects/bridge.ts is its contract: each effect's methods, the arguments each takes, what each answers and what each event carries. Kotlin data classes, Swift Codable structs and the TypeScript types are generated from it, so a name or a shape that disagrees fails the type check, the Kotlin compile or the Swift compile. What crosses at run time is checked too: in a debug build the shell checks every call's arguments, every answer and every event against the contract, and a call or an answer that breaks it fails with E0433 naming the method and the field, rather than reaching a route that would read the wrong thing (decision 0151). A release build does not check.

How to fix it

Send the arguments the contract gives the method, or answer with the shape it gives. If the contract itself is what changed, edit spec/effects/bridge.ts and run pnpm generate, then fix what the type check, Kotlin and Swift report.

In a terminal

duolith explain E0433

Mentioned in