Skip to content

Conversation

n3-rd
Copy link

@n3-rd n3-rd commented Sep 18, 2025

What

  • Make --space for space info accept a required value (<did>)
  • Add a guard for the case where --space is provided without a value, and emit a clear usage error.
  • Add a small DID shape validation for earlier, user-friendly errors.

Why

Currently space info --space (or -s) without a value sets opts.space === true. The handler then treats true like a DID and passes it into the client, producing a runtime error:

$ storacha space info --space
Error getting info about true: query.test is not a function

This should be fixed as

$ storacha space info --space    
Error: --space requires a DID value (e.g. --space did:key:...)

@n3-rd n3-rd requested a review from travis as a code owner September 18, 2025 12:47
Copy link
Contributor

@Dhruv-Varshney-developer Dhruv-Varshney-developer left a comment

Choose a reason for hiding this comment

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

Interesting. Thanks!

*/
export async function spaceInfo(opts) {
const client = await getClient()
if (typeof opts.space === 'boolean') {
Copy link
Member

@travis travis Sep 24, 2025

Choose a reason for hiding this comment

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

the error message here is wrong - --space does not require a value, it defaults to the currently selected space unless you specify a DID. I'd remove this whole clause - if space is given as a boolean it will be caught below in the other new check you added

Co-authored-by: Travis Vachon <[email protected]>
@n3-rd n3-rd requested a review from travis September 27, 2025 05:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants