Kgothatso Ngako f38a5f12f3 fix: ask relays for gift wraps addressed to us, not to our peers
Three kind:1059 sync filters named the wrong pubkey.

ChatMessageListViewModel asked for `#p:[peer]` with no author constraint,
which subscribes to every wrap anyone has ever sent that peer. None of it is
decryptable by us, and it is the direct source of the Invalid Mac saves fixed
in the previous commit. It now asks for `#p:[us]` on our own DM relays — the
only shape of gift wrap filter that can return something we hold a key for.
The peer's relays were the wrong place to look regardless: under NIP-17 a
sender publishes to the *recipient's* DM relays, so our mail lands on ours.

The two in NostrDao asked for `authors:[userPublicKey]` + `#p:[participant]`,
commented "messages from this relay that were sent by us". A gift wrap is
signed by the throwaway key from GiftWrapEvent.create, never by the sender's
identity key, so no author value we could know will ever match one. These
requests were queued once per participant and always reconciled to empty —
failing silently rather than loudly, which is why they outlived the bug that
made the third filter visible. Both `if (chatMessageRelayListEvent != null)`
branches held nothing else, so each is inverted to the `== null` case that
does the real work: warn, and queue a profile sync for the participant whose
DM relay list we are missing. Nothing is lost; neither filter ever returned
an event.

Two things worth recording about what a filter can and cannot express here.

A wrap discloses only its recipient, so "the messages in this conversation"
is not askable — `#p:[us]` pulls the whole inbox and that is the narrowest
correct request. That is the privacy property being paid for, not a
limitation to work around.

Sent-message recovery is likewise not a filter problem. It needs a second
wrap addressed to ourselves at send time, which giftWrapAndBroadcast does not
yet emit; the `#p:[us]` filters already in place would pick those up with no
new subscription.

purpose on the chat message request changes from "sent-messages" to "chat",
matching the now-identical filter in ChatRoomListViewModel. Since computeId
buckets by minute and NegentropySynchronizeRequestDao upserts, the two
collapse into a single request rather than racing as separate rows.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-05 23:07:03 +02:00
2026-07-05 23:21:02 +02:00
2026-07-28 09:10:20 +02:00
2026-03-24 04:47:19 +02:00
2026-03-23 01:41:39 +02:00
2026-03-23 01:41:39 +02:00
2026-03-23 01:41:39 +02:00

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 thats 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 Apples 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 youre 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 IDEs 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 IDEs 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 IDEs toolbar or open the /iosApp directory in Xcode and run it from there.


Learn more about Kotlin Multiplatform

Description
Mantra as a kotlin multiplatform project
https://mantra.press
Readme 8.2 MiB
Languages
Kotlin 100%