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 support to duplicate BSQ swap offers #5886

Conversation

ripcurlx
Copy link
Contributor

@ripcurlx ripcurlx commented Dec 2, 2021

Fixes #5865.

As BSQ swap offers have their own creation form I didn't want to bloat the duplicate offer tab, but rather re-use the create offer form.

Bildschirmfoto 2021-12-02 um 13 46 45

Bildschirmfoto 2021-12-02 um 13 46 52

Bildschirmfoto 2021-12-02 um 13 46 14

@ripcurlx ripcurlx added this to the v1.8.0 milestone Dec 2, 2021
@ripcurlx ripcurlx requested a review from chimp1984 December 2, 2021 12:49
@ghost
Copy link

ghost commented Dec 2, 2021

@ripcurlx ACK for invocation from Open Offers.
It should work the same from History. Looks like it was an issue even before this PR, FWIW.


Dec-02 13:40:13.522 [JavaFX Application Thread] ERROR bisq.common.setup.CommonSetup: Uncaught Exception from thread JavaFX Application Thread 
Dec-02 13:40:13.523 [JavaFX Application Thread] ERROR bisq.common.setup.CommonSetup: throwableMessage= No value present 
Dec-02 13:40:13.523 [JavaFX Application Thread] ERROR bisq.common.setup.CommonSetup: throwableClass= class java.util.NoSuchElementException 
Dec-02 13:40:13.524 [JavaFX Application Thread] ERROR bisq.common.setup.CommonSetup: Stack trace:
java.util.NoSuchElementException: No value present
    at java.base/java.util.Optional.orElseThrow(Optional.java:382)
    at bisq.desktop.main.portfolio.closedtrades.ClosedTradesView.lambda$initialize$10(ClosedTradesView.java:268)
    at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
    at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:234)
    at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
    at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
    at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
    at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:49)
    at javafx.event.Event.fireEvent(Event.java:198)
    at javafx.scene.control.MenuItem.fire(MenuItem.java:459)
    at com.sun.javafx.scene.control.ContextMenuContent$MenuItemContainer.doSelect(ContextMenuContent.java:1385)
    at com.sun.javafx.scene.control.ContextMenuContent$MenuItemContainer.lambda$createChildren$12(ContextMenuContent.java:1338)

@ripcurlx
Copy link
Contributor Author

ripcurlx commented Dec 3, 2021

@ripcurlx ACK for invocation from Open Offers. It should work the same from History. Looks like it was an issue even before this PR, FWIW.

Dec-02 13:40:13.522 [JavaFX Application Thread] ERROR bisq.common.setup.CommonSetup: Uncaught Exception from thread JavaFX Application Thread 
Dec-02 13:40:13.523 [JavaFX Application Thread] ERROR bisq.common.setup.CommonSetup: throwableMessage= No value present 
Dec-02 13:40:13.523 [JavaFX Application Thread] ERROR bisq.common.setup.CommonSetup: throwableClass= class java.util.NoSuchElementException 
Dec-02 13:40:13.524 [JavaFX Application Thread] ERROR bisq.common.setup.CommonSetup: Stack trace:
java.util.NoSuchElementException: No value present
    at java.base/java.util.Optional.orElseThrow(Optional.java:382)
    at bisq.desktop.main.portfolio.closedtrades.ClosedTradesView.lambda$initialize$10(ClosedTradesView.java:268)
    at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86)
    at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:234)
    at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191)
    at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58)
    at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114)
    at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74)
    at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:49)
    at javafx.event.Event.fireEvent(Event.java:198)
    at javafx.scene.control.MenuItem.fire(MenuItem.java:459)
    at com.sun.javafx.scene.control.ContextMenuContent$MenuItemContainer.doSelect(ContextMenuContent.java:1385)
    at com.sun.javafx.scene.control.ContextMenuContent$MenuItemContainer.lambda$createChildren$12(ContextMenuContent.java:1338)

Missed to add it there as well ☝️
I'm thinking about adding an additional action column (copy icon) as well to make it more visible as mentioned by @chimp1984.

@ripcurlx
Copy link
Contributor Author

ripcurlx commented Dec 3, 2021

Maybe only in History and and My open offers first, as within Open trades it might become a little bit confusing.

@ripcurlx
Copy link
Contributor Author

ripcurlx commented Dec 3, 2021

I've added a copy icon column in Open offers and History to communicate the copy offer functionality more visually. I still kept the duplicate offer right click as it is also possible in pending offers which would just cause confusion if there is a duplicate offer column there as well.

Bildschirmfoto 2021-12-03 um 11 46 08
Bildschirmfoto 2021-12-03 um 12 01 35

ghost
ghost previously approved these changes Dec 3, 2021
Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

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

ACK

@chimp1984
Copy link
Contributor

The top level enable toggle is not aligned:
Screenshot 2021-12-03 at 12 01 45

@chimp1984
Copy link
Contributor

The duplicate icon is shown also for the taker in history. When clicking it shows a popup. Better to use that data to not show it in the first place IMO.

@@ -572,6 +575,33 @@ private void updateButtonDisableState() {
isPlaceOfferButtonDisabled.set(createOfferRequested || !inputDataValid || miningPoW.get());
}

private void maybeInitializeWithData() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe rename to maybeApplyFromDuplicateOffer or the like, to make the use case more clear. I check if the offer is null at the caller would also help to make it more clear when its applied.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I kept the naming more general, as I though that there could be other use cases as well. Like some onboarding form in the future that automatic pre-fills a buy BSQ form.
Regarding the offer null check. Where do you want to see this?

Copy link
Contributor

Choose a reason for hiding this comment

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

I meant to have the if check for null could be done at the caller of maybeInitializeWithData and then its not a maybe anymore... but no strong opinion either... It just took a bit more effort to understand the code that ways as one need to jump to the method to see whats really going on there to see that its only an optional case if the param is null.

@ripcurlx
Copy link
Contributor Author

ripcurlx commented Dec 6, 2021

Just pushed the last alignment fix of the enable/disable all button

Bildschirmfoto 2021-12-06 um 10 47 47

Bildschirmfoto 2021-12-06 um 10 47 53

@ripcurlx ripcurlx force-pushed the add-bsq-swap-duplicate-offer-support branch from e0c9051 to c6c2ae5 Compare December 6, 2021 09:53
@ripcurlx ripcurlx force-pushed the add-bsq-swap-duplicate-offer-support branch from c6c2ae5 to a1ecf35 Compare December 6, 2021 10:04
Copy link
Contributor

@chimp1984 chimp1984 left a comment

Choose a reason for hiding this comment

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

utACK

@chimp1984
Copy link
Contributor

Fixes #5774

Copy link
Contributor

@bisq-github-admin-3 bisq-github-admin-3 left a comment

Choose a reason for hiding this comment

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

utACK - based on #5886 (review) and #5886 (review)

@bisq-github-admin-3 bisq-github-admin-3 merged commit 5041dc5 into bisq-network:master Dec 7, 2021
@ghost ghost mentioned this pull request Jan 11, 2022
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.

[v1.8.0] Duplication of BSQ swap offers not supported
3 participants