Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sendAsync method result response formatted #3996

Merged
merged 5 commits into from
Dec 20, 2023

Conversation

kr-nikunj
Copy link
Contributor

@kr-nikunj kr-nikunj commented Nov 29, 2023

Creating a release? Please use the Release PR Template instead.

Description

fixed JSON RPC response in specific format, issue: #3984

return {
    id,
    jsonrpc: "2.0",
    result,
  };

Type of change

  • Chore (non-breaking change that addresses non-functional tasks, maintenance, or code quality improvements)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Draft PR (breaking/non-breaking change which needs more work for having a proper functionality [Mark this PR as ready to review only when completely ready])
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

How has this been tested?

Using manually testing of logs and and running the test file

Use this table template to show examples of your changes:

Before After
image image

Checklist

  • I have performed a self-review of my own code
  • My changes generate no new warnings
  • Any dependent changes have been merged and published in downstream modules

this.request(args, chain)
.then((response) => callback(null, response))
.catch((error) => callback(error, undefined));
.then((response) => callback(null, formatJsonRpcResult(id, response)))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.then((response) => callback(null, formatJsonRpcResult(id, response)))

Do we need to format the response here? Afaik all responses are already formatted as jsonRpcResult by the responding client

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, the client is not responding in a formatted manner

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

@ganchoradkov, Facing the same issue while running these test cases on the main branch, please check it

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please make sure you run

  • npm i in root to fetch new packages
  • npm run reset to rebuild the monorepo
    for some reason the relay is rejecting your jwt and/or projectId

also your system's datetime as jwt is valid for 1 day so if you datetime is forward/back in time might cause it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @ganchoradkov, I tried that also and ran it in a local file but it gave the same error. For passing the test case there might be a change in the workflow file of the repo where it is not getting environment variables correctly.

If possible can I DM you on Discord or any other platform to resolve this issue?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@GanchoRadkov on telegram

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ganchoradkov, can you please tell me where you set environment variables?

image
in workflow file:
https://github.com/WalletConnect/walletconnect-monorepo/actions/runs/7084385293/workflow?pr=3996

Because I run test cases locally and it's running properly. and facing issue here only.

@kr-nikunj
Copy link
Contributor Author

In the universal provider's test file ( walletconnect-monorepo/providers/universal provider/test/shared/constant.ts), If I put my project ID and relay id directly, it passes all test cases. for getting the environment variable it failed test cases.

image

image

This is run while I define my project ID directly to a constant file

image

please check it @ganchoradkov

Copy link
Member

@ganchoradkov ganchoradkov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for fixing @kr-nikunj 💯 🥇

@ganchoradkov ganchoradkov linked an issue Dec 20, 2023 that may be closed by this pull request
@ganchoradkov ganchoradkov merged commit 91af38e into WalletConnect:v2.0 Dec 20, 2023
4 of 9 checks passed
@ganchoradkov ganchoradkov mentioned this pull request Dec 21, 2023
20 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

JSON RPC response is in invalid format
2 participants