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

GetTrades should not filter open failed trades #7023

Merged
merged 1 commit into from Feb 25, 2024
Merged

GetTrades should not filter open failed trades #7023

merged 1 commit into from Feb 25, 2024

Conversation

ghost
Copy link

@ghost ghost commented Feb 1, 2024

Fixes #7022

@dutu
Copy link

dutu commented Feb 4, 2024

Thanks @jmacxx, I've applied and tested the change on v1.9.14 and it works as intended.

However, I could not see an obvious way to differentiate a trade that has failed from a valid trade.
Would it be possible to expose to the API an additional trade field (such as hasFailed, errorMessage or isMaybeInvalidTrade)?

The idea is to be able to use FailTrade(), which can only be done if the trade is identified.

Note: The issue with leaving a failed trade in the open trade list, is when the offer is made available again and a new trade is taken. The new trade will have the same id as previously failed trade (the id of the offer). I have previously encountered issues when calling a trade API method complaining the trade is in an invalid state (it seems that due to two trades with same id, the failed trade was picked up when calling the method).

Copy link
Contributor

@alvasw alvasw left a comment

Choose a reason for hiding this comment

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

Nit

I know that someone else wrote the original code but we should try to clean up existing code when working on it. We can avoid the redudant copying of the trade list by using Collections.unmodifiableList(getObservableList()).

Apart from that I aggree with @dutu. API consumers should be able to tell whether a trade failed.

core/src/main/java/bisq/core/trade/TradeManager.java Outdated Show resolved Hide resolved
@ghost ghost marked this pull request as draft February 9, 2024 18:18
@ghost ghost marked this pull request as ready for review February 12, 2024 19:17
@ghost
Copy link
Author

ghost commented Feb 12, 2024

Would it be possible to expose to the API an additional trade field (such as hasFailed, errorMessage

Added has_failed and error_message properties to API TradeInfo record.

@alejandrogarcia83 alejandrogarcia83 added this to the v1.9.15 milestone Feb 13, 2024
API add has_failed and error_message properties to TradeInfo.
Code review fixes from @dutu.
Copy link
Contributor

@alvasw alvasw left a comment

Choose a reason for hiding this comment

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

utACK

Copy link
Contributor

@alejandrogarcia83 alejandrogarcia83 left a comment

Choose a reason for hiding this comment

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

utACK

@alejandrogarcia83 alejandrogarcia83 merged commit e53fb35 into bisq-network:master Feb 25, 2024
3 checks passed
@ghost ghost mentioned this pull request Feb 29, 2024
@alejandrogarcia83 alejandrogarcia83 modified the milestones: v1.9.15, v1.9.16 Apr 9, 2024
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.

Open failed trade not returned by RPC method GetTrades
3 participants