JoinColony / colonyDapp

Colony dApp client
49 stars 19 forks source link

Timeout before TX receipt has been received #2107

Closed Karol-colony closed 4 years ago

Karol-colony commented 4 years ago

Steps to reproduce

  1. Example: log in with a MetaMask wallet (I recommend mainnet)
  2. Create 10 tasks with a budget
  3. Finalize tasks at a cheapest rate, try to do this in short period of time like 15 min
  4. Compare metamask transaction with list of task, look up for tasks which were finalized (it has to be visible on etherscan) but still are displayed as open

Expected behaviour

Actual behaviour

Suggestions (optional)

Note: this can be problematic as user might be misleaded to pay twice. Please create separate issue to solve this issue after the investigative task is complete.

rdig commented 4 years ago

@auryn-macmillan and @Karol-colony please let me know of any tasks that are in this state so I can (at least) manually close them from the server side.

rdig commented 4 years ago

In order to properly fix this we need a cron-like service on the server side that checks for when the tx has actually been mined.

The gist of the change is to put the task in a "Payment Pending" state on the app side, then, on the server side, periodically check when that tx has been mined and update the database entries to reflect. (basically we need the resulting potId from that transaction receipt)

Since this quite a major change (code-wise at least) I want to pull both you @collinvine and @chmanie in for a quick chat around this.

Let me know when you have time, as I want to start on this properly as soon as I can.

rdig commented 4 years ago

A quick stop-gap solution for this could be:

Still keep the TX checking logic on the app side, but have an intermediate step as well:

All of the above happening on the server side.

This approach has the advantage of stopping a task being payed multiple times and gives us some breathing room in order to develop a "proper" solution, the one I've mentioned above.