Skip to content
This repository has been archived by the owner on May 28, 2021. It is now read-only.

[Node] Deposit app gets stuck for async transfers #1407

Open
ArjunBhuptani opened this issue Aug 28, 2020 · 0 comments
Open

[Node] Deposit app gets stuck for async transfers #1407

ArjunBhuptani opened this issue Aug 28, 2020 · 0 comments
Labels
Bug Something isn't working p0 CRITICAL CRITICAL bugfixes and security problems leading to potential loss of funds

Comments

@ArjunBhuptani
Copy link
Member

There's at least one bug here:

Imagine a case where a deposit app is proposed, but then the install fails for some reason (e.g. user offline).

If this happens, an evt timeout will be thrown from the requestDepositRights fn in deposit.service.ts. Then, we'll execute the cleanUpDepositRights() fn in the catch block. All good so far.

cleanUpDepositRights(), however, does the following:

    const cleanUpDepositRights = async () => {
      if (appIdentityHash) {
        this.log.info(
          `Releasing deposit rights on chain ${channel.chainId} for ${channel.multisigAddress}`,
        );
        await this.rescindDepositRights(appIdentityHash, channel.multisigAddress);
        this.log.info(
          `Released deposit rights on chain ${channel.chainId} for ${channel.multisigAddress}`,
        );
      }
    };

where appIdentityHash = await this.requestDepositRights(channel, assetId);

If appIdentityHash is undefined (e.g. because the requestDepositRights function itself failed), we wont do anything to cleanUpDepositRights() here. Because the user is also offline, they won't be around to rejectInstall as per the try/catch in handleAppProposal in the client.

Not sure where this leaves the client but we should definitely handle this case better.

@ArjunBhuptani ArjunBhuptani added Bug Something isn't working p0 CRITICAL CRITICAL bugfixes and security problems leading to potential loss of funds labels Aug 28, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Bug Something isn't working p0 CRITICAL CRITICAL bugfixes and security problems leading to potential loss of funds
Projects
None yet
Development

No branches or pull requests

1 participant