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

added the functionality to introduce different timeout value for Web3… #6336

Merged
merged 4 commits into from
Aug 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/web3-core/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,3 +168,8 @@ Documentation:
### Fixed

- Fixed rpc errors not being sent as an inner error when using the `send` method on request manager (#6300).

### Added

- To fix issue #6190, added the functionality to introduce different timeout value for Web3. (#6336)

6 changes: 4 additions & 2 deletions packages/web3-core/src/web3_batch_request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,15 @@ export class Web3BatchRequest {
}

// eslint-disable-next-line class-methods-use-this
public async execute(): Promise<JsonRpcBatchResponse<unknown, unknown>> {
public async execute(options?: {
timeout?: number;
}): Promise<JsonRpcBatchResponse<unknown, unknown>> {
if (this.requests.length === 0) {
return Promise.resolve([]);
}

const request = new Web3DeferredPromise<JsonRpcBatchResponse<unknown, unknown>>({
timeout: DEFAULT_BATCH_REQUEST_TIMEOUT,
timeout: options?.timeout ?? DEFAULT_BATCH_REQUEST_TIMEOUT,
Copy link
Contributor

Choose a reason for hiding this comment

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

thanks for your contribution. This should be mentioned in changelog.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

apologies @jdevcs are you suggesting any change?

Copy link

Choose a reason for hiding this comment

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

@jdevcs Was the checklist not necessary? I couldn't even build the project and therefore abandoned the task.

Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

@jdevcs Was the checklist not necessary? I couldn't even build the project and therefore abandoned the task.

Could you share problems you were stuck? Most of items are also checks in CI ( lint, build, tests etc)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

apologies @jdevcs are you suggesting any change?

This should be added in changelog files : https://github.com/shubhamshd/web3.js/blob/4.x/packages/web3-core/CHANGELOG.md and https://github.com/shubhamshd/web3.js/blob/4.x/packages/web3/CHANGELOG.md

Ok I just need to update the changelog files right ? under unreleased section?
I'll just create new commit and update the existing pr thanks @jdevcs

Copy link
Contributor

Choose a reason for hiding this comment

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

yes, please update these changelog files

Copy link
Contributor Author

@shubhamshd shubhamshd Aug 14, 2023

Choose a reason for hiding this comment

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

done, please review @avkos @jdevcs

Copy link
Contributor

Choose a reason for hiding this comment

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

Due to recent release there are some file conflicts,
could you see those, or one of our team member can fix if you dnt have time. I am approving PR but I'll merge PR after fixes. Thanks

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jdevcs I have resolved the conflict and updated the pr
Could you please review this now and merge, thanks!!!

eagerStart: true,
timeoutMessage: 'Batch request timeout',
});
Expand Down
4 changes: 4 additions & 0 deletions packages/web3/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,3 +140,7 @@ Documentation:
- Added minimum support of web3.extend function

## [Unreleased]

### Added

- To fix issue #6190, added the functionality to introduce different timeout value for Web3. (#6336)
Loading