bosonprotocol / interface

End to End dCommerce experience built using the Boson Protocol Core Components SDK
https://bosonapp.io/
Apache License 2.0
10 stars 1 forks source link

bug when showing completed transactions #810

Closed levalleux-ludo closed 1 year ago

levalleux-ludo commented 1 year ago

Problem is seen on testing env (mumbai) with account 0x1b05Ba94aCc29d0D66a0114a0bC7Daa139153BE5

image

image

image

levalleux-ludo commented 1 year ago

In the subgraph, some fundsEventLogs entities exist without funds field (that is mandatory in the schema). Example

Looking at the code, this can happen when 0 price offers and/or 0 seller deposits are created. If a seller creates a 0 price offer, or an offer wirth 0 seller deposit, a buyer can commit even if the seller didn't deposit any funds yet. When committing, the event FundsEncumbered is raised for the seller and the buyer, in which case the amount is 0 (see code). In the subgraph handler for this event, we suppose that FundsEncumbered can not happen before FundsDeposited happen code, which is wrong.