Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(connext): reject app install for transfers without status field #1863

Merged
4 commits merged into from
Sep 7, 2020

Conversation

ghost
Copy link

@ghost ghost commented Sep 3, 2020

This PR changes the logic around how Connext.lookupPayment handles transfer statuses without a status field.

Previously, we'd always consider the payment as pending. We're now attempting to reject the app proposal install. If successful, we're considering the payment as permanently failed.

Closes #1850

@raladev raladev requested review from raladev and sangaman September 3, 2020 13:25
@raladev raladev assigned ghost Sep 3, 2020
@raladev
Copy link
Contributor

raladev commented Sep 3, 2020

waiting for connext/rest-api-client#92

@kilrau
Copy link
Contributor

kilrau commented Sep 3, 2020

sangaman
sangaman previously approved these changes Sep 3, 2020
Copy link
Collaborator

@sangaman sangaman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, this is an important fix.

lib/connextclient/ConnextClient.ts Show resolved Hide resolved
@ghost ghost requested a review from sangaman September 4, 2020 11:23
@ghost
Copy link
Author

ghost commented Sep 4, 2020

This PR requires us to update the connext client to 1.3.3 and node to latest.

sangaman
sangaman previously approved these changes Sep 4, 2020
Copy link
Collaborator

@sangaman sangaman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@raladev
Copy link
Contributor

raladev commented Sep 7, 2020

  • looks like something wrong with request building
07/09/2020 12:58:47.365 [CONNEXT] trace: hashlock status for connext transfer with hash 78fd7f8c20b16263196a01c3b0c6e7b6f80b14f430339db2882d2c2aa7e4e6b0 is undefined
07/09/2020 12:58:47.366 [CONNEXT] debug: no hashlock status for connext transfer with hash 78fd7f8c20b16263196a01c3b0c6e7b6f80b14f430339db2882d2c2aa7e4e6b0: {"senderIdentifier":"indra7TdM96xqgvso2oG3zNyaoN7xebyfHMskPb5Fp8bffk8R8qYqkk","receiverIdentifier":"indra7GFej81aBFjQjEeStYCKbf8mqWD5N39k4Y8QSfwzh4zjcArhP5","senderAppIdentityHash":"0x66f3ea4db257993d7e5905a4c86cf69a172cdb98f55a8f75579becb8b3168aee","assetId":"0x0000000000000000000000000000000000000000","amount":"1000000000000000000","lockHash":"0x78fd7f8c20b16263196a01c3b0c6e7b6f80b14f430339db2882d2c2aa7e4e6b0","expiry":"154671"} - attempting to reject app install proposal
07/09/2020 12:58:47.367 [CONNEXT] trace: sending request to /reject-install: {}
07/09/2020 12:58:47.376 [CONNEXT] error: connext server error 500: Internal Server Error
07/09/2020 12:58:47.384 [CONNEXT] error: failed to reject connext app install proposal: 8.5 - connext server error 500: Internal Server Error
[1599483527637] INFO  (70 on connext): Getting client for publicIdentifier: indra7TdM96xqgvso2oG3zNyaoN7xebyfHMskPb5Fp8bffk8R8qYqkk
2020-09-07T12:58:47.724Z [NodeApiClient] Node responded to indra7TdM96xqgvso2oG3zNyaoN7xebyfHMskPb5Fp8bffk8R8qYqkk.indra6WRA6HQQTDQD1FC3KmdbpePijdcgLTqAdi2xy2Q2HqNeGn4cBh.1337.transfer.get-hashlock request in 87 ms
[1599483527724] INFO  (70 on connext): request completed
    url: "/hashlock-status/0x7a8a75ef8925e97f6e05f5394868148c053ef7e878feaa67d2dd7821d7331068/0x0000000000000000000000000000000000000000"
    statusCode: 200
    reqId: 860
[1599483527726] INFO  (70 on connext): received request
    url: "/reject-install"
    id: 861
    reqId: 861
[1599483527726] ERROR (70 on connext): Invalid or missing appIdentityHash
    Error: Invalid or missing appIdentityHash
        at Object.requireParam (/app/build/src/helpers/utilities.js:51:15)
        at /app/build/src/index.js:781:31
        at step (/app/build/src/index.js:44:23)
        at Object.next (/app/build/src/index.js:25:53)
        at /app/build/src/index.js:19:71
        at new Promise (<anonymous>)
        at __awaiter (/app/build/src/index.js:15:12)
        at Object.<anonymous> (/app/build/src/index.js:775:106)
        at preHandlerCallback (/app/node_modules/fastify/lib/handleRequest.js:120:28)
        at Auth.next [as done] (/app/node_modules/fastify/lib/hooks.js:158:7)
[1599483527727] INFO  (70 on connext): request completed
    url: "/reject-install"
    statusCode: 500
    reqId: 861
[1599483528209] INFO 

Copy link
Contributor

@raladev raladev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

above

@raladev raladev self-requested a review September 7, 2020 14:36
@ghost ghost merged commit 519aa54 into master Sep 7, 2020
@ghost ghost deleted the feat/connext-reject-app-install branch September 7, 2020 16:10
rsercano pushed a commit that referenced this pull request Sep 11, 2020
…1863)

* feat(connext): reject app install for transfers without status field
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Call /reject-install for payments without status
3 participants