Skip to content
This repository has been archived by the owner on Nov 22, 2022. It is now read-only.

Webhook for sign_transaction is not being fired/ credentials not forwarded #31

Open
Akonobi1 opened this issue Jul 16, 2021 · 9 comments
Assignees
Labels
bug Something isn't working

Comments

@Akonobi1
Copy link

In Kin.java, the getPassthroughAppUserCredentials() function gets called and the values logged, but Agora does not send them with a sign_transaction request on TestNet. **The credentials below are private.

2021-07-16 07:51:22.151 10549-10641/com.gftzhu.kindling I/System.out: account.accounts.isEmpty(): false
2021-07-16 07:51:22.867 10549-10640/com.gftzhu.kindling D/ContentValues: getPassthroughAppUserCredentials: xxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxx
2021-07-16 07:51:23.020 10549-10641/com.gftzhu.kindling I/System.out: account.accounts.isEmpty(): false
2021-07-16 07:51:23.613 10549-10640/com.gftzhu.kindling D/ContentValues: getPassthroughAppUserCredentials: xxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxx

These values never get sent to my server with a transaction request...

DEBUG:root:Received sign transaction request for <None,None>
DEBUG:root:transaction approved: b'3kSwNYK7FmHTYG2pfH4JBQ91FAf6c8Kc4V32hv9So1ifAoMSJ5crpi58KiA5exvsiyjPUSCY2PbLvG1PLug74okX' (1 payments)
INFO:werkzeug:54.87.229.123 - - [16/Jul/2021 09:51:24] "POST /sign_transaction HTTP/1.1" 200 -
DEBUG:root:transaction completed: 89804f538a97a4cdbbd0752b329eb34de2675c52e4f8dea8538975c0e3db32da52565b38ebd69af9b74094bcd8251160c21c845efbaa3e85c8c3d95cfadb250c

@skyf0xx
Copy link

skyf0xx commented Jul 20, 2021

@Akonobi1 what were you using for server side? Could you confirm it was Python? (We'll need to try and replicate it)

@Akonobi1
Copy link
Author

I do use Python and the standard webhook.py in the examples dir of the python sdk

@skyf0xx skyf0xx added bug Something isn't working and removed bug Something isn't working labels Jul 22, 2021
@skyf0xx
Copy link

skyf0xx commented Jul 22, 2021

First step is to see if we can replicate this

@Akonobi1
Copy link
Author

Any news on this issue?

@skyf0xx
Copy link

skyf0xx commented Nov 2, 2021

Just a note that this is similar to this closed issue

#17

@Akonobi1
Copy link
Author

Akonobi1 commented Nov 3, 2021

Yes. I've seen that.

Nevertheless, since my python sign_transaction function (from the example webhook handler) approves requests, it ought also fetch the headers if the issue is fixed.

Since I use Java to initiate a spend from a device, either the Java code is not working well with the Kotlin-coded function, OR the provided example webhook handler has a problem with its logic.

I question whether it is simply a problem with our validator node because I think therein lies the problem with transactions not completing as well, of course a different issue altogether, but perhaps related.

@skyf0xx skyf0xx self-assigned this Nov 17, 2021
@skyf0xx
Copy link

skyf0xx commented Nov 17, 2021

I have confirmed the client side SDK was fixed - still testing back end.

@skyf0xx
Copy link

skyf0xx commented Nov 18, 2021

The back end is not firing for test net and production - the only hook that fires is for events but not sign_transaction. This was tested both with a webhook secret and without.

This is identical to @Akonobi1 report on discord.

Knowns:

  1. Issue originally in Android in getPassthroughAppUserCredentials() was fixed getPassthroughAppUserCredentials() override is not fired for API version 4 #17
  2. The webhook for event is triggered but sign_transaction is not being triggered in Test and Production for Python
  3. The webhook for event is triggered but sign_transaction is not being triggered in Test and Production for NodeJs

Conclusion:

The most likely cause is a bug in Agora

An alternate is that even if Android's getPassthroughAppUserCredentials() is now being triggered in Android, it may not be sending the correct header to Agora

Recommended action:

Test iOS and NodeJs/ Python

  1. If the sign transaction webhook fires, then the issue is in the Android SKD
  2. If the sign transaction webhook does not fire, then Agora needs to be tested

@skyf0xx skyf0xx changed the title Kin.java "getPassthroughAppUserCredentials()" not forwarding appUserId and appUserPasskey values to API to send to backend Webhook for sign_transaction is not being fired Nov 18, 2021
@skyf0xx skyf0xx added the bug Something isn't working label Nov 18, 2021
@skyf0xx skyf0xx changed the title Webhook for sign_transaction is not being fired Webhook for sign_transaction is not being fired/ credentials not forwarded Dec 10, 2021
@skyf0xx
Copy link

skyf0xx commented Dec 10, 2021

Another issue as mentioned by @Akonobi1 is that when it fires, the credentials are not forwarded by Agora (just the message).

This was an older issue that seems to have been superseded by the hook not firing at all.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants