docs/marmot-v2.md, Phase 6: "a terminal rejection resolves FAILED, discarding the pending state with the live group already correct." The phase's commit built the CONFIRMED half and left every other outcome pending, on the grounds that the broadcast queue reported a timeout and a relay's refusal the same way -- both were "failed" -- and a timeout must stay pending, since its retry re-sends the same bytes and may yet be accepted. The cost of that was a room whose commit a relay refused outright: its obligation never resolved, `canPrepareLocalCommit` stayed false, and every later invite, removal or disband was refused with "try again in a moment" for as long as the room existed. The refusal was re-sent on every launch and refused again. The two are distinguishable, and now are. `RelayPool` already surfaces an `["OK", id, false, reason]` as a `NostrPublishException` carrying the relay's reason, apart from socket errors and timeouts; `BroadcastStatus.of(error)` turns that into a status. A reason a relay will keep giving -- `blocked:`, `invalid:`, `pow:`, `restricted:` -- is the new "rejected", which the requeue on launch leaves alone: the same bytes to the same relay get the same answer. A `rate-limited:` or `error:` refusal is "failed" like a timeout, because those change. And a `duplicate:` refusal is "published": the relay is saying it has the event, which is what published means, and it is the answer a byte-identical retry gets from a relay that took the first copy. The four statuses that were string literals across the sync pump, the navigation gate and the DAO are named on the same object. `DatabaseNostrRepository.broadcastProcessed` gains the relay's reason and a "rejected" branch. One relay's refusal decides nothing -- another may still accept, and a timeout on another is retried -- so the obligation is discarded only when every request row for the event is "rejected": `MarmotEngine.discardRejected` resolves it FAILED, the gate drops the clone, the live group having never advanced, and the room can prepare a commit again. Nothing is told to convergence, since a commit no relay carries is not a branch any member will see. The room says what happened, in the relay's words, because the screen that asked closed when the commit was made: an invite gets the existing `TYPE_MEMBER_INVITE_FAILED` line, and a removal or a disband step gets a new `TYPE_CHANGE_REJECTED` line, since the caption written when it was asked for would otherwise stand uncorrected. `PublishBeforeApplyJvmTest` gains the plan's third case: with a two-relay scope, one refusal leaves the obligation, a timeout on the other leaves it, the other's refusal discards it -- epoch unchanged, the peer not a member, the line naming the reason -- and the same peer can be invited again. 1187 tests green, Android debug compile, M3 audit. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This is a Kotlin Multiplatform project targeting Android, iOS, Desktop (JVM).
-
/composeApp is for code that will be shared across your Compose Multiplatform applications. It contains several subfolders:
- commonMain is for code that’s common for all targets.
- Other folders are for Kotlin code that will be compiled for only the platform indicated in the folder name. For example, if you want to use Apple’s CoreCrypto for the iOS part of your Kotlin app, the iosMain folder would be the right place for such calls. Similarly, if you want to edit the Desktop (JVM) specific part, the jvmMain folder is the appropriate location.
-
/iosApp contains iOS applications. Even if you’re sharing your UI with Compose Multiplatform, you need this entry point for your iOS app. This is also where you should add SwiftUI code for your project.
Build and Run Android Application
To build and run the development version of the Android app, use the run configuration from the run widget in your IDE’s toolbar or build it directly from the terminal:
- on macOS/Linux
./gradlew :composeApp:assembleDebug - on Windows
.\gradlew.bat :composeApp:assembleDebug
Build and Run Desktop (JVM) Application
To build and run the development version of the desktop app, use the run configuration from the run widget in your IDE’s toolbar or run it directly from the terminal:
- on macOS/Linux
./gradlew :composeApp:run - on Windows
.\gradlew.bat :composeApp:run
Build and Run iOS Application
To build and run the development version of the iOS app, use the run configuration from the run widget in your IDE’s toolbar or open the /iosApp directory in Xcode and run it from there.
Learn more about Kotlin Multiplatform…