OriginProtocol / origin-bridge

We've moved to a monorepo: https://github.com/OriginProtocol/origin/tree/master/infra/bridge
MIT License
15 stars 7 forks source link

Remove IPFS picture data when creating or updating reviews #104

Closed ambertch closed 6 years ago

ambertch commented 6 years ago

When the indexer creates or updates listings, the picture data is removed from the IPFS content: https://github.com/OriginProtocol/origin-bridge/blob/develop/logic/indexer_service.py#L48

The method to create or update reviews, which also store IPFS data, should also remove picture data: https://github.com/OriginProtocol/origin-bridge/blob/develop/logic/indexer_service.py#L97

micahalcorn commented 6 years ago

Done via #109 ✅

franckc commented 6 years ago

Actually, I did some more testing and investigation in the code. I don't think the JSON blob we store in IPFS for reviews has any image...

Here is the origin.js code that writes the IPFS data: https://github.com/OriginProtocol/origin-js/blob/49fe587c5fe1380015ec35422edb2fed857312f6/src/resources/purchases.js#L71 It stores two fields: "version" and "reviewText".

Here is an example of the review data: https://gateway.originprotocol.com/ipfs/QmZLtFJkn19VFfWFxLyrESpZybaEMEFEYU87p3rRCrN7NY {"version":1,"reviewText":"That was fun!"}

Maybe I'm missing something ? @ambertch what made you think the IPFS data for reviews had images in it ?

ambertch commented 6 years ago

@franckc That's my mistake, thanks for catching it. I did not know that the IPFS hash referenced in the Purchase methods was a review object, and assumed it was a listing.

franckc commented 6 years ago

@ambertch No problem, my bad. I should have more thoroughly looked at the code creating the IPFS data. Sent PR #111 to fix.