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!: use MultihashDigest type in stores #1474

Merged
merged 9 commits into from
Jun 7, 2024

Conversation

alanshaw
Copy link
Member

@alanshaw alanshaw commented May 17, 2024

This forces callers to decode Uint8Arrays that may come from user input before the storage method is called and that means we don't just use them without validation that they are actually a multihash.

BREAKING CHANGE: AllocationsStorage and BlobsStorage methods not take MultihashDigest types instead of Uint8Arrays.

Copy link
Contributor

@vasco-santos vasco-santos left a comment

Choose a reason for hiding this comment

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

please mark this as breaking change :)

@alanshaw alanshaw changed the title fix: use MultihashDigest type in stores fix!: use MultihashDigest type in stores May 17, 2024
@@ -126,21 +124,17 @@ export class BlobsStorage {
this.content = content
}

/** @param {import('multiformats').MultihashDigest} digest */
/** @param {Types.MultihashDigest} digest */
#bucketPath(digest) {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: could we call this param multihashDigest everywhere? it feels weird now, and we have some digest.digest

Copy link
Member Author

Choose a reason for hiding this comment

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

So verbose though, and we very rarely use digest.digest... 😄

Copy link
Contributor

Choose a reason for hiding this comment

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

mhDigest instead? 😅
anyway, I don't strongly oppose if you want to keep as this

@alanshaw alanshaw force-pushed the fix/use-multihashdigest-type1 branch from 739e02c to d9bd509 Compare June 6, 2024 12:31
@alanshaw alanshaw merged commit 6c6a3bd into main Jun 7, 2024
5 checks passed
@alanshaw alanshaw deleted the fix/use-multihashdigest-type1 branch June 7, 2024 10:31
alanshaw pushed a commit that referenced this pull request Jun 10, 2024
🤖 I have created a release *beep* *boop*
---


##
[18.0.0](upload-api-v17.1.0...upload-api-v18.0.0)
(2024-06-07)


### ⚠ BREAKING CHANGES

* `AllocationsStorage` and `BlobsStorage` methods not take
`MultihashDigest` types instead of `Uint8Array`s.

### Features

* publish index claim
([#1487](#1487))
([237b0c6](237b0c6))


### Fixes

* stop writing to DUDEWHERE
([#1500](#1500))
([cf0a1d6](cf0a1d6))
* use MultihashDigest type in stores
([#1474](#1474))
([6c6a3bd](6c6a3bd))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
alanshaw pushed a commit that referenced this pull request Jun 13, 2024
🤖 I have created a release *beep* *boop*
---


##
[15.0.0](w3up-client-v14.1.1...w3up-client-v15.0.0)
(2024-06-13)


### ⚠ BREAKING CHANGES

* `AllocationsStorage` and `BlobsStorage` methods not take
`MultihashDigest` types instead of `Uint8Array`s.

### Features

* utility exports for better UX
([#1505](#1505))
([54b0d93](54b0d93))


### Fixes

* use MultihashDigest type in stores
([#1474](#1474))
([6c6a3bd](6c6a3bd))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.

2 participants