Skip to content

Commit

Permalink
fix: look for the correct capability in client.capability.upload.get (
Browse files Browse the repository at this point in the history
#1357)

I was seeing some strange errors in the nft.storage work I'm doing right
now and realized it's a result of a copypasta bug in `upload-client`
where we query for the wrong capability when putting together this
invocation.

We missed this in testing because tests use one big proof, which means
that asking for `upload/add` is equivalent to asking for `upload/get` -
in an ideal world I'd spend a bit of time untangling this but since I'm
at the bottom of a stack of shaved yaks I'd like to get this shipped and
file an issue to come back to this later.
  • Loading branch information
Travis Vachon authored Apr 11, 2024
1 parent 6fa7797 commit 77199fe
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 57 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"docs:markdown": "pnpm run build && docusaurus generate-typedoc"
},
"devDependencies": {
"@arethetypeswrong/cli": "^0.12.2",
"@arethetypeswrong/cli": "^0.15.3",
"@docusaurus/core": "^3.0.0",
"@docusaurus/preset-classic": "^3.0.0",
"docusaurus-plugin-typedoc": "^0.21.0",
Expand Down
2 changes: 1 addition & 1 deletion packages/w3up-client/src/capability/upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export class UploadClient extends Base {
* @param {import('../types.js').RequestOptions} [options]
*/
async get(root, options = {}) {
const conf = await this._invocationConfig([UploadCapabilities.add.can])
const conf = await this._invocationConfig([UploadCapabilities.get.can])
options.connection = this._serviceConf.upload
return Upload.get(conf, root, options)
}
Expand Down
106 changes: 51 additions & 55 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 77199fe

Please sign in to comment.