-
Notifications
You must be signed in to change notification settings - Fork 33
Conversation
This is for interfacing with local storage in a browser-compatible way
This is more consistent with existing terminology
Notifications now depend on listings. If a listing request crashes because the ipfs data is malformed, we won't even be able to finish generating the notifications.
1883ce0
to
9938ff6
Compare
Thanks, @tyleryasaka 👏 Really great work. I am getting two notifications with the same
Also, I'm going to need to map the role of the user to this object in addition to obviously getting the relevant data (listing details, purchase details, etc) to produce a friendly message. Should any of this be done on the origin-js side since you already seem to have strung the necessary async calls together? Thoughts evolved below 👇 |
@@ -38,6 +38,7 @@ | |||
"form-data": "^2.3.2", | |||
"map-cache": "^0.2.2", | |||
"rlp": "^2.0.0", | |||
"store": "^2.0.12", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
@tyleryasaka here is my WIP branch: https://github.com/OriginProtocol/demo-dapp/tree/notifications Since we aren't going to be "indexing notifications" on the bridge server, then I'm wondering what is the best way to limit the number of requests for this information. Perhaps it makes sense to put all of a user's listings and purchases in the DApp redux store as soon as they load the first page. Then we can probably map all of my content described above using the stored collections. That would effectively cache all of the other routes too. ❓ Maybe we at least return the |
This also seems to fix some weird bug where we were getting logs with identitcal data but different block hashes/numbers
@micahalcorn The duplicate notification seems to have had something to do with a bug in the purchase logs. I refactored that solidity code and I'm not seeing duplicate notifications any more. Let me know if you have any more issues with that. Sorry about leaving out listing and purchase in the notification object! That would be helpful to have. They're there now, under the Yeah, on the react side you should probably implement some sort of caching. Redux store seems like the way to do that. I think what I have now should address all the concerns you mentioned - let me know if not or if you need anything else! |
Checklist:
Update any relevant READMEs and docsdevelop
branch instead ofmaster
Description:
This creates an API for client-side notifications with no dependencies other than local storage. Notifications are built directly from blockchain data, and read/unread state is stored in local storage.
I implemented the following notification types:
seller_listing_purchased
seller_review_received
buyer_listing_shipped
buyer_review_received
This can be adjusted/expanded in the future as needed.
Closes #211