Coder Social home page Coder Social logo

anchor-link-browser-transport's People

Contributors

aaroncox avatar apporc avatar dafuga avatar jnordberg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

anchor-link-browser-transport's Issues

Upon receiving a 410 response code, notify the user their wallet needs to reconnect

Users who have a pending signing request, and subsequently perform another action that queues up a second signing request, will receive a 410 error code on the request.

We may want to catch this 410 and display a useful error to the user that they should start/restart/reconnect their wallet to receive the pending requests before performing additional requests.

Surface error messages returned by Resource Provider APIs to user

During the Resource Provider sampling process, we can catch errors involving the transaction before its sent to the users wallet. These aren't resource errors, they are errors with the contract the user is trying to interact with. Currently these errors are returned as part of the API response but not surfaced to the user. The current flow is:

  • User starts transaction.
  • Transport checks resource requirements.
  • If there's an error during sampling, the API returns the error to the transport.
  • The transport currently just proceeds without cosigning and without prompting the error.
  • The user signs using their wallet, and it often fails from resource issues.
  • The user powerup/rents/etc and tries again, and now they see the error.

We should change the transport to surface the errors that occur during sampling. The flow should be:

  • User starts transaction.
  • Transport checks resource requirements.
  • If there's an error during sampling, the API returns the error to the transport.
  • The transport prompts the error to the user and the transaction flow is halted.
  • The user corrects the error (if possible) and resubmits, the transaction is cosigned and successful.

TypeError: Cannot assign to read only property 'prepareStatusEl' of object '#<BrowserTransport>'

Hello. I'm having trouble setting up anchor-link on a React + Typescript app.
I'm using the same code in a Vue app, and everything is working fine.

I'm able to login and the the user's session, however when I try to use the transact function, I'm getting this error:

Uncaught (in promise) TypeError: Cannot assign to read only property 'prepareStatusEl' of object '#<BrowserTransport>'
    at BrowserTransport.showLoading (app.js:9870:30)
    at LinkChannelSession.showLoading (app.js:10784:40)
    at Link.transact (app.js:11298:15)
    at LinkChannelSession.transact (app.js:10797:37)
    at app.js:31552:24
    at step (app.js:31363:19)
    at Object.next (app.js:31293:14)
    at app.js:31265:67
    at new Promise (<anonymous>)
    at __webpack_modules__../resources/js/Domains/Wallet/useWallet.ts.__awaiter (app.js:31244:10)

It references the line 366 of anchor-link-browser-transport's index.ts

this.prepareStatusEl = status

Any advice on how can I proceed?

Thanks in advance

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.