Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

ipfs-core-types@0.9.0 - Out of date types for BWOptions #3985

Closed
SgtPooki opened this issue Dec 16, 2021 · 4 comments 路 Fixed by #4061
Closed

ipfs-core-types@0.9.0 - Out of date types for BWOptions #3985

SgtPooki opened this issue Dec 16, 2021 · 4 comments 路 Fixed by #4061
Assignees
Labels

Comments

@SgtPooki
Copy link
Member

Hi! 馃憢

Firstly, thanks for your work on this project! 馃檪

Today I used patch-package to patch ipfs-core-types@0.9.0 for the project I'm working on.

A number is no longer valid for the interval property of BWOptions. In order to successfully call the ipfs.stats.bw endpoint with TypeScript, you must either //@ts-ignore or avoid passing interval.

See https://docs.ipfs.io/reference/http/api/#api-v0-stats-bw

Here is the diff that solved my problem:

diff --git a/node_modules/ipfs-core-types/src/stats/index.ts b/node_modules/ipfs-core-types/src/stats/index.ts
index 43e5f24..30dbf86 100644
--- a/node_modules/ipfs-core-types/src/stats/index.ts
+++ b/node_modules/ipfs-core-types/src/stats/index.ts
@@ -16,7 +16,7 @@ export interface BWOptions extends AbortOptions {
   peer?: string
   proto?: string
   poll?: boolean
-  interval?: number
+  interval?: string
 }
 
 export interface BWResult {

This issue body was partially generated by patch-package.

@welcome
Copy link

welcome bot commented Dec 16, 2021

Thank you for submitting your first issue to this repository! A maintainer will be here shortly to triage and review.
In the meantime, please double-check that you have provided all the necessary information to make this process easy! Any information that can help save additional round trips is useful! We currently aim to give initial feedback within two business days. If this does not happen, feel free to leave a comment.
Please keep an eye on how this issue will be labeled, as labels give an overview of priorities, assignments and additional actions requested by the maintainers:

  • "Priority" labels will show how urgent this is for the team.
  • "Status" labels will show if this is ready to be worked on, blocked, or in progress.
  • "Need" labels will indicate if additional input or analysis is required.

Finally, remember to use https://discuss.ipfs.io if you just need general support.

@achingbrain
Copy link
Member

I think it needs to be number | string to align with https://github.com/ipfs/js-ipfs/blob/master/packages/ipfs-core/src/components/stats/bw.js#L11 which allows you to pass intervals like '1s'.

If that works for you, would you like to open a PR that fixes the issue?

@BigLep
Copy link
Contributor

BigLep commented Jan 7, 2022

@SgtPooki : are you ok to open a PR to fix the issue?

@SgtPooki
Copy link
Member Author

SgtPooki commented Mar 3, 2022

@BigLep for sure. I can get a PR out really quick

@SgtPooki SgtPooki self-assigned this Mar 3, 2022
@SgtPooki SgtPooki added the status/ready Ready to be worked label Mar 3, 2022
SgtPooki added a commit to SgtPooki/js-ipfs that referenced this issue Mar 3, 2022
@SgtPooki SgtPooki added status/in-progress In progress and removed status/ready Ready to be worked labels Mar 3, 2022
achingbrain added a commit that referenced this issue Apr 5, 2022
fix #3985

Co-authored-by: achingbrain <alex@achingbrain.net>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants