Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add trade process domain #153

Merged
merged 25 commits into from
Jan 15, 2025

Conversation

HenrikJannsen
Copy link
Contributor

No description provided.

@rodvar rodvar self-assigned this Jan 13, 2025
@rodvar
Copy link
Collaborator

rodvar commented Jan 13, 2025

Hey Henrik! Thanks for this huge contrib. Just a heads up, I cannot test it (details below). In the meantime I'll start code-reviewing

Android Node

It won't build error is

Projects/bisq-mobile/androidNode/src/androidMain/kotlin/network/bisq/mobile/android/node/presentation/NodeSplashPresenter.kt:17:100 No value passed for parameter 'settingsServiceFacade'.

But a repository is passed instead?

Clients

I can't do anything because it seems the profile functionality got broken? Every trading functionality of even trying to see the profile clicking in the avatar gives crashes like this

Caused by: kotlinx.serialization.MissingFieldException: Fields [payloadEncoded, challengeEncoded, solutionEncoded] are required for type with serial name 'network.bisq.mobile.domain.data.replicated.security.pow.ProofOfWorkVO', but they were missing
    at 0   presentation                        0x10bf962cf        kfun:kotlin.Exception#<init>(kotlin.String?;kotlin.Throwable?){} + 143 (/opt/buildAgent/work/ed783494cd2364bc/kotlin/kotlin-native/runtime/src/main/kotlin/kotlin/Exceptions.kt:25:70)
    at 1   presentation                        0x10bf964ef        kfun:kotlin.RuntimeException#<init>(kotlin.String?;kotlin.Throwable?){} + 143 (/opt/buildAgent/work/ed783494cd2364bc/kotlin/kotlin-native/runtime/src/main/kotlin/kotlin/Exceptions.kt:36:70)
    at 2   presentation                        0x10bf9686f        kfun:kotlin.IllegalArgumentException#<init>(kotlin.String?;kotlin.Throwable?){} + 143 (/opt/buildAgent/work/ed783494cd2364bc/kotlin/kotlin-native/runtime/src/main/kotlin/kotlin/Exceptions.kt:61:70)

@HenrikJannsen
Copy link
Contributor Author

HenrikJannsen commented Jan 13, 2025

Projects/bisq-mobile/androidNode/src/androidMain/kotlin/network/bisq/mobile/android/node/presentation/NodeSplashPresenter.kt:17:100 No value passed for parameter 'settingsServiceFacade'.

Ups was a last minute change yesterday. Fixed with recent commit.

I can't do anything because it seems the profile functionality got broken? Every trading functionality of even trying to see the profile clicking in the avatar gives crashes like this

Caused by: kotlinx.serialization.MissingFieldException: Fields [payloadEncoded, challengeEncoded, solutionEncoded] are required for type with serial name 'network.bisq.mobile.domain.data.replicated.security.pow.ProofOfWorkVO', but they were missing

Be sure to have both mobile and backend on latest verison, clean and build all and publish all. Maybe restart Fleet. I had some issues in Android Studio when doing bigger changes.

./gradlew clean build --refresh-dependencies might help as well.

@HenrikJannsen HenrikJannsen force-pushed the add-trade-process-domain branch from 028dc7e to 031e5c9 Compare January 13, 2025 06:01
@HenrikJannsen
Copy link
Contributor Author

I am adding commits with refactoring and readme updates. Some areas are work in progress... those changes are pure refactorings, so no need to review those in depth. Once I am complete with that I will post it, but no need to block review or merge.

@HenrikJannsen HenrikJannsen force-pushed the add-trade-process-domain branch from 3302191 to 6407553 Compare January 13, 2025 12:15
@rodvar
Copy link
Collaborator

rodvar commented Jan 13, 2025

First tests on Android Node

  • can take sell btc offer, all the process works as expected :D
  • can take buy btc offer, all the process works as expected :D
  • close trade -> crashes UI, node stops sync correctly only way to fix it is to force stop the app through system settings (commited a fix @HenrikJannsen please review)
  • "I received btc" button crashes the UI as well if the user doesn't input the btc proof, the code expects ui to force user to input proof, I'll do a crash avoid fix for now

There is sometimes a random error UI crash (UI turns completely blank) , not sure if its related but I found this exception on the logs. IT's not always reproducible, will keep trying to repro

Build configuration failed!
                                                                                                   java.lang.IllegalArgumentException: Must pass in a valid surface control if only instrument surface; 
                                                                                                   	at com.android.internal.jank.InteractionJankMonitor$Configuration.validate(InteractionJankMonitor.java:1259)
                                                                                                   	at com.android.internal.jank.InteractionJankMonitor$Configuration.<init>(InteractionJankMonitor.java:1217)
                                                                                                   	at com.android.internal.jank.InteractionJankMonitor$Configuration.<init>(Unknown Source:0)
                                                                                                   	at com.android.internal.jank.InteractionJankMonitor$Configuration$Builder.build(InteractionJankMonitor.java:1197)
                                                                                                   	at com.android.internal.jank.InteractionJankMonitor.begin(InteractionJankMonitor.java:611)
                                                                                                   	at android.view.inputmethod.ImeTracker$ImeJankTracker.onRequestAnimation(ImeTracker.java:717)
                                                                                                   	at android.view.InsetsController$InternalAnimationControlListener$2.onAnimationStart(InsetsController.java:448)
                                                                                                   	at android.animation.Animator$AnimatorListener.onAnimationStart(Animator.java:695)
                                                                                                   	at android.animation.Animator$AnimatorCaller$$ExternalSyntheticLambda0.call(Unknown Source:4)
                                                                                                   	at android.animation.Animator.callOnList(Animator.java:669)
                                                                                                   	at android.animation.Animator.notifyListeners(Animator.java:608)
                                                                                                   	at android.animation.Animator.notifyStartListeners(Animator.java:625)
                                                                                                   	at android.animation.ValueAnimator.startAnimation(ValueAnimator.java:1334)
                                                                                                   	at android.animation.ValueAnimator.start(ValueAnimator.java:1149)
                                                                                                   	at android.animation.ValueAnimator.start(ValueAnimator.java:1173)
                                                                                                   	at android.view.InsetsController$InternalAnimationControlListener.onReady(InsetsController.java:470)
                                                                                                   	at android.view.InsetsAnimationThreadControlRunner.lambda$new$0(InsetsAnimationThreadControlRunner.java:129)
                                                                                                   	at android.view.InsetsAnimationThreadControlRunner.$r8$lambda$3zGKYd3XPzPnvMO2hiF8a88M6T0(Unknown Source:0)
                                                                                                   	at android.view.InsetsAnimationThreadControlRunner$$ExternalSyntheticLambda2.run(Unknown Source:6)
                                                                                                   	at android.os.Handler.handleCallback(Handler.java:958)
                                                                                                   	at android.os.Handler.dispatchMessage(Handler.java:99)
                                                                                                   	at android.os.Looper.loopOnce(Looper.java:205)
                                                                                                   	at android.os.Looper.loop(Looper.java:294)
                                                                                                   	at android.os.HandlerThread.run(HandlerThread.java:67)

@rodvar
Copy link
Collaborator

rodvar commented Jan 14, 2025

Also getting this when closing a transaction

Request transaction from https://mempool.emzy.de failed with java.util.concurrent.CompletionException: java.lang.RuntimeException: java.io.IOException: Request to https://mempool.bisq.services/api/tx/sdffsd failed with error: Invalid hex string 2025-01-14 11:57:42.312 14354-14505 System.out network.bisq.mobile.node.debug I

@rodvar rodvar force-pushed the add-trade-process-domain branch from defd43c to a80b06e Compare January 14, 2025 01:05
@rodvar rodvar force-pushed the add-trade-process-domain branch from a80b06e to 9b8b966 Compare January 14, 2025 04:57
@rodvar
Copy link
Collaborator

rodvar commented Jan 14, 2025

finally figured it out, no more white screens when closing the trade workflow

@rodvar rodvar force-pushed the add-trade-process-domain branch from 9b8b966 to a30de03 Compare January 14, 2025 05:33
@rodvar
Copy link
Collaborator

rodvar commented Jan 14, 2025

looks like the trade flow presenter calls go back 4 times simultaneously when the trade is completed

52.075  22394-22394 TradeFlowPresenter      network.bisq.mobile.client.debug     I  goBack default implementation
52.076  22394-22394 TradeFlowPresenter      network.bisq.mobile.client.debug     I  goBack default implementation
52.077  22394-22394 TradeFlowPresenter      network.bisq.mobile.client.debug     I  goBack default implementation
52.077  22394-22394 TradeFlowPresenter      network.bisq.mobile.client.debug     I  goBack default implementation

Copy link
Collaborator

@rodvar rodvar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK

Tested and working on the 3 apps, some small issues were encountered and fixed along the way as described in GH logs in this branch.

Awesome work Henrik, excited for the next ones 🎉

androidClient/build.gradle.kts Show resolved Hide resolved
val contract: BisqEasyContract = Mappings.BisqEasyContractMapping.toBisq2Model(value.bisqEasyTradeModel.contract)
mediationRequestService.requestMediation(channel, contract)
}
return Result.success(Unit)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add error handling(try/catch) ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mediation is WIP

@@ -18,4 +18,4 @@ SPEC CHECKSUMS:

PODFILE CHECKSUM: 431d52ef58584308462794999ebead56142b0160

COCOAPODS: 1.16.2
COCOAPODS: 1.15.2
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this downgrade needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, was uninteded from merge

iosClient/iosClient.xcodeproj/project.pbxproj Show resolved Hide resolved
fun Throwable.getRootCause(): Throwable {
var rootCause: Throwable = this
while (rootCause.cause != null && rootCause.cause != rootCause) {
rootCause = rootCause.cause!!
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rootCause.cause?.let { rootCause = it } to avoid !! usage

@rodvar
Copy link
Collaborator

rodvar commented Jan 15, 2025

Implementation for #95 #96 #98 & #54 (Facade with jars usages for androidNode and ws gateway for clients)

@rodvar rodvar merged commit 640e676 into bisq-network:main Jan 15, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants