[bisq-network/bisq] Fix intermittent blank price cells in offer book view (#4420)

Steven Barclay notifications at github.com
Thu Aug 20 11:23:23 UTC 2020


<!-- 
- make yourself familiar with the CONTRIBUTING.md if you have not already (https://github.com/bisq-network/bisq/blob/master/CONTRIBUTING.md)
- make sure you follow our [coding style guidelines][https://github.com/bisq-network/style/issues)
- pick a descriptive title
- provide some meaningful PR description below
- create the PR
- in case you receive a "Change request" and/or a NACK, please react within 30 days. If not, we will close your PR and it can not be up for compensation.
- After addressing the change request, __please re-request a review!__ Otherwise we might miss your PR as we tend to only look at pull requests tagged with a "review required".
-->

Replace faulty cell update logic, which uses a `ChangeListener<Scene>`, added in July 2017 (#73f21399) to keep the price column in the offer book table up to date, as it appears to occasionally result in blank cells. Also it seems only the prices, not the volumes, were being kept in sync with the market price feed.

Make the price and volume cells stateless and keep them in sync with the market feed by adding it as a dependency of each `OfferBookListItem` Observable generated by the cell value factory, instead of directly attaching listeners to it. In this way, `TableCell::updateItem` will be called by the framework whenever the price/volume needs updating.

(This does have the disadvantage that if the price feed is unavailable, causing `Offer::getPrice` to return null, then the cells will reflect that immediately instead of showing any old, stale values, but that is necessary for the UI to behave consistently anyway.)

--

This is to fix issues like the following, that I have occasionally observed in the Sell Bitcoin offer book, filtered for BSQ (though never in the Buy Bitcoin offer book or for other counter currencies for some reason):


You can view, comment on, or merge this pull request online at:

  https://github.com/bisq-network/bisq/pull/4420

-- Commit Summary --

  * Rename misleading OfferBookChartViewModel method name
  * Fix intermittent blank price cells in offer book view

-- File Changes --

    M desktop/src/main/java/bisq/desktop/main/market/offerbook/OfferBookChartViewModel.java (27)
    M desktop/src/main/java/bisq/desktop/main/offer/offerbook/OfferBookView.java (74)

-- Patch Links --

https://github.com/bisq-network/bisq/pull/4420.patch
https://github.com/bisq-network/bisq/pull/4420.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/bisq-network/bisq/pull/4420
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20200820/14300d19/attachment.html>


More information about the bisq-github mailing list