mailchain/mailchain-legacy

Prevent going to receiver each time get messages is stored.

Closed this issue · 3 comments

Is your feature request related to a problem? Please describe.
Current GET /messages endpoint checks the source for new messages. If there is a problem with a downstream receiver then its not possible to get any messages.

Describe the solution you'd like
Create a check method that talks to the receiver then stores message in the state store. Use the state store with get messages.

  • Create POST /messages endpoint and use the same with the same request parameters as /messages
  • New method will get message the same way as GET /messages however it will store them in the state database
  • expand /stores/state.go with extra methods e.g. PutMessage, GetMessages and use these methods when adding messages from GET
  • extended stores/bdbstore with new methods
  • Find the correct keys to store
  • remove stores/ldbstore
  • Change GET /messages to retrieve message from state store

Hi @robdefeo , you can assign the task to me. I m a little bit confused about POST /messages. We already have this endpoint here. I guess you meant to change functionality of GET /messages using state database, am I right?

Hi @olimpias I'll try to clarify. Want to aim for functionality of GET to retrieve messages from the local state store and POST to force checking against the blockchain. Later we can have a background check using the functionality that POST does to automatically check messages. I was thinking POST as it creates messages though open to suggestions on the design implementation.

Thanks for offering to pick this up 😄 let me know if you have any additional questions

closed by #652