kin-node icon indicating copy to clipboard operation
kin-node copied to clipboard

Missing "Earns" for app users: Node SDK should fail gracefully for "unknown" return code from Agora, instead of returning "success"

Open rorymc opened this issue 3 years ago • 1 comments

The submit transaction result only accounts for "error" or "success", and mis-handles "unknown" as "success" https://github.com/kinecosystem/kin-node/blob/4295b4fbde73714c7bd63771ca0ac066b0300f7a/src/client/internal.ts#L49

this causes the issue where if Agora or blockchain has a problem (e.g. runs out of SOL, the blockchain has some delay), then Agora will return "unknown" instead of "error" or "success". Here's the problem:

  • ios/android SDKs handle "unknown", and gracefully retry
  • node SDK does NOT handle it properly, and returns "success"

this leads to the problem where:

  • when Agora/Solana blockchain has a hiccup, it returns txn IDs to node SDK clients as "successful" txns, however those txns do not exist on the blockchain
  • clients don't know any better, and thus cannot retry properly ==> missing Earns for app users

see discussion in this Discord thread.

rorymc avatar Jan 07 '22 02:01 rorymc

Transferring information here posted by @richardmands

https://discord.com/channels/808859554997469244/923258669846655036/928755367654084638

image

skyf0xx avatar Jan 10 '22 01:01 skyf0xx