OriginProtocol / origin-js

We've moved to a monorepo: https://github.com/OriginProtocol/origin
MIT License
81 stars 33 forks source link

Invalid Offer Developer Experience #558

Closed micahalcorn closed 5 years ago

micahalcorn commented 5 years ago

As mentioned here and here, it may not be appropriate to throw errors when invalid offers are retrieved. If a method is called, which internally retrieves all offers matching a certain criteria, these errors will surface and prevent the returning of the expected value. This is a bad developer experience because the caller didn't explicitly ask for the invalid thing and the request itself was valid. This can also lead to side effects that are bad for end users.

I don't know if it's best to just silently swallow the invalid offers, log errors, or what.

cc @franckc @DanielVF @tyleryasaka

DanielVF commented 5 years ago

I think it's good to throw them from origin.js, but when it's not an error we need to show the user, something at the dapp layer needs to catch and ignore these errors.

micahalcorn commented 5 years ago

@DanielVF but if I call getNotifications and someone has injected an invalid listing that matches my filters, I will never get them, right?

tyleryasaka commented 5 years ago

I'll fix this shortly