question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

WsProvider.subscribe does not always return a promise

See original GitHub issue

Workaround here - https://github.com/polkadot-js/api/blob/master/packages/rpc-core/src/index.ts#L199

To reproduce -

  • Remove the wrapping Promise.resolve as linked
  • Run the rpc-core/formatting tests, the error will be logged

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
jacogrcommented, Jul 26, 2019

It does pass yes, but it logs on the console.

So run with yarn test:one ... (botch scenarios - in the commented scenario the errors are displayed)

0reactions
polkadot-js-botcommented, Jun 5, 2021

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue if you think you have a related problem or query.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to use the @polkadot/api.ApiPromise.create function in ...
The callback is fired when new headers // are found, the call itself returns a promise with a subscription that can be //...
Read more >
Angular 2 Property subscribe does not exist on type Promise ...
subscribe method is for 'Observable', so you can just return an Observable Object. then do what you want to do like this
Read more >
@polkadot/api WsProvider TypeScript Examples
This page shows TypeScript code examples of @polkadot/api WsProvider. ... isReady unfortunately doesn't wait for those properly await new Promise((resolve) ...
Read more >
Using promises - JavaScript - MDN Web Docs
A Promise is an object representing the eventual completion or ... Important: Always return results, otherwise callbacks won't catch the ...
Read more >
ApiPromise - Overview
As a full Promise-based, all interface calls return Promises, ... use is to be made of the subscription-based features of Polkadot (and Substrate)...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found