fcl-js icon indicating copy to clipboard operation
fcl-js copied to clipboard

PreAuthz Payer is appended to the payer array even if it is a different account

Open justinbarry opened this issue 2 years ago • 7 comments

Problem

Previously when a payer was added to a transaction it overrode the current payer. With #1040 the payers became an array. Currently, when a new payer (meaning new address, not a different key) is added it is appended to the array instead of replacing it which is the previous default.

justinbarry avatar Jun 02 '22 15:06 justinbarry

Is this one fixed? Been a while

highskore avatar Sep 03 '22 00:09 highskore

@lukaracki Closed as resolved by https://github.com/onflow/fcl-js/issues/1262

gregsantos avatar Sep 06 '22 15:09 gregsantos

I'm still getting "Payer cannot be different accounts" with fcl 1.2.0

The same error which I was getting that caused this exact issue to be raised. Here's the discord thread: https://discord.com/channels/613813861610684416/699275726704083064/981598487357575219

highskore avatar Sep 06 '22 15:09 highskore

@gregsantos

highskore avatar Sep 07 '22 00:09 highskore

Thanks @lukaracki Will have to dig into this again if you are still seeing the same issue. @bthaile Hoping maybe you have insight into this issue or potential fix.

gregsantos avatar Sep 07 '22 14:09 gregsantos

Should we reopen this issue or make a new one?

highskore avatar Sep 15 '22 08:09 highskore

Getting this error with 1.3.1 as well

ShainDholakiya avatar Oct 06 '22 19:10 ShainDholakiya

@ShainDholakiya Do you have a snippet I could see to reproduce this?

justinbarry avatar Nov 08 '22 19:11 justinbarry

Do not get the error anymore

ShainDholakiya avatar Nov 08 '22 19:11 ShainDholakiya

How did you solve this? You managed to have your server account pay for the transaction while having the user give his account's Auth to the transaction script?

Itahand avatar Nov 21 '22 16:11 Itahand

@justinbarry

I tested this again, looks like it works if you put the current user as the payer, but if the payer is the serverAuthorization it doesn't work (and it worked in pre 1.0 fcl):

works:

authorizations([authz, serverAuthorization]),
payer(authz),
proposer(authz),

doesn't:

authorizations([authz, serverAuthorization]),
payer(serverAuthorization),
proposer(authz),

highskore avatar Nov 21 '22 17:11 highskore

don't know how or why it worked for me before but does not work anymore. signer is the server auth

proposer: signer,
payer: fcl.authz,
authorizations: [fcl.authz, signer],

ShainDholakiya avatar Nov 23 '22 10:11 ShainDholakiya

Can we get some attention on this issue? It is causing us to not use the latest fcl because we need this and that is not ideal.

bjartek avatar Aug 29 '23 07:08 bjartek

@bjartek could you please test whether https://github.com/onflow/fcl-js/pull/1532 fixes your issue?

you can use these versions:

    "@onflow/fcl": "1.6.0-accounts.1",
    "@onflow/fcl-wc": "4.0.0-accounts.1",
    "@onflow/sdk": "1.2.3-accounts.1",
    "@onflow/transport-grpc": "1.2.2-accounts.0",
    "@onflow/transport-http": "1.7.2-accounts.1",

nialexsan avatar Oct 23 '23 19:10 nialexsan