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

fix: support non-200 RPC error #1404

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

fix: support non-200 RPC error #1404

wants to merge 6 commits into from

Conversation

19Nazar
Copy link

@19Nazar 19Nazar commented Oct 11, 2024

Pre-flight checklist

Motivation

I want to solve problems and contribute to Near ecosystems

Related issues/PRs

Solved problam with support non-200 RPC error codes this issues #1395

Copy link

changeset-bot bot commented Oct 11, 2024

⚠️ No Changeset found

Latest commit: d203d42

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@19Nazar
Copy link
Author

19Nazar commented Oct 29, 2024

@race-of-sloths

@race-of-sloths
Copy link

@19Nazar Thank you for your contribution! Your pull request is now a part of the Race of Sloths!

Shows inviting banner with latest news.

Shows profile picture for the author of the PR

Current status: waiting for scoring

We're waiting for maintainer to score this pull request with @race-of-sloths score [0,1,2,3,5,8,13] command. Alternatively, autoscoring [1,2] will be applied for this pull request

What is the Race of Sloths

Race of Sloths is a friendly competition where you can participate in challenges and compete with other open-source contributors within your normal workflow

For contributors:

  • Tag @race-of-sloths inside your pull requests
  • Wait for the maintainer to review and score your pull request
  • Check out your position in the Leaderboard
  • Keep weekly and monthly streaks to reach higher positions
  • Boast your contributions with a dynamic picture of your Profile

For maintainers:

  • Score pull requests that participate in the Race of Sloths
  • Engage contributors with fair scoring and fast responses so they keep their streaks
  • Promote the Race to the point where the Race starts promoting you
  • Grow the community of your contributors

Feel free to check our website for additional details!

Bot commands
  • For contributors
    • Include a PR: @race-of-sloths include to enter the Race with your PR
  • For maintainers:
    • Invite contributor @race-of-sloths invite to invite the contributor to participate in a race or include it, if it's already a runner.
    • Assign points: @race-of-sloths score [1/2/3/5/8/13] to award points based on your assessment.
    • Reject this PR: @race-of-sloths exclude to send this PR back to the drawing board.
    • Exclude repo: @race-of-sloths pause to stop bot activity in this repo until @race-of-sloths unpause command is called

Copy link

@PolyProgrammist PolyProgrammist left a comment

Choose a reason for hiding this comment

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

Hi @19Nazar

Thank you for the valuable PR! Nice job

Left a few comments

@@ -60,10 +60,12 @@ export async function fetchJsonRpc(url: string, json: JsonRpcRequest, headers: o
throw new ProviderError(await res.text(), { cause: status });
Copy link

@PolyProgrammist PolyProgrammist Nov 7, 2024

Choose a reason for hiding this comment

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

So when status is other than 200, the ok is false, so after we get 500, 408 or another error, we stop here. So I suggest to move this line if (!ok) to the bottom of the function

Also, have you tested your solution? If not, please test.

@@ -60,10 +60,12 @@ export async function fetchJsonRpc(url: string, json: JsonRpcRequest, headers: o
throw new ProviderError(await res.text(), { cause: status });
}

if (status === 503) {

Choose a reason for hiding this comment

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

What is the reason for removing 503 error? It is still the case as I see in the nearcore code. It should be retried as well

@PolyProgrammist
Copy link

Hi @19Nazar please let me know if you are going to finish the PR

@19Nazar
Copy link
Author

19Nazar commented Nov 13, 2024

Hi @19Nazar please let me know if you are going to finish the PR

Hi, I'll get it done today

@19Nazar
Copy link
Author

19Nazar commented Nov 13, 2024

result test
image

@19Nazar
Copy link
Author

19Nazar commented Nov 13, 2024

@race-of-sloths

@19Nazar
Copy link
Author

19Nazar commented Nov 14, 2024

@PolyProgrammist give feedback when you've checked it out

@PolyProgrammist
Copy link

Looks good to me @gtsonevv @frol please check / merge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: NEW❗
Development

Successfully merging this pull request may close these issues.

3 participants