unlock-protocol / unlock

Ʉnlock is a protocol for memberships built on a blockchain.
https://unlock-protocol.com
MIT License
839 stars 248 forks source link

production tickets is broken #3098

Closed cellog closed 5 years ago

cellog commented 5 years ago

I just bought my ticket to the nft meetup, and the page froze on "Payment sent". Investigating further yielded the following:

Screen Shot 2019-05-09 at 8 58 34 AM Screen Shot 2019-05-09 at 8 57 39 AM

This is in web3Service:

  async getTransaction(transactionHash, defaults) {
    return Promise.all([this.provider.getBlockNumber(), this.provider.getTransaction(transactionHash)]).then(async ([blockNumber, blockTransaction]) => {
      // Let's find the type of contract before we can get its version
      const to = blockTransaction ? blockTransaction.to : defaults.to;

The defaults array does not have to set in it!

The defaults is set in web3Middleware:

        // When a new transaction was created, retrieve it
        if (action.type === NEW_TRANSACTION) {
          web3Service.getTransaction(
            action.transaction.hash,
            action.transaction
          )
        }

This is totally standard, the paywall does the same thing. The NEW_TRANSACTION action was dispatched from:

    walletService.on(
      'transaction.new',
      (transactionHash, from, to, input, type, status) => {
        // At this point we know that a wallet was found, because a new transaction
        // cannot be created without it
        dispatch(gotWallet())
        dispatch(
          newTransaction({
            hash: transactionHash,
            to,
            from,
            input,
            type: transactionTypeMapping(type),
            status,
            network: getState().network.name,
          })
        )
      }
    )

This implies that walletService sent out a 'transaction.new' event without a filled in to field. However, the state is correct:

Screen Shot 2019-05-09 at 9 06 03 AM

Unfortunately, the redux action that was the basis of this scrolled away before I figured out I needed to look at it.

julien51 commented 5 years ago

I think the to thing might be a different bug. Probably a transaction from locksmith on a different chain rinkeby vs. mainnet.

cellog commented 5 years ago

I saw the same error with a new event I created on staging in coinbase wallet FYI