clockworklabs / clockworklabs/SpacetimeDB

CLI `spacetime call` cannot pass `Identity` argument for browser account linking command from website

Open
#5,242 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
25.2k
Forks
1.1k
Avg merge
2d 7h
Merged PRs (30d)
46

Description

Summary

On Windows PowerShell, the command generated by the SpacetimeDB website for linking a browser identity to a logged-in CLI identity fails with argument parsing errors.

This appears to be either:

  • a Windows PowerShell quoting issue,
  • a CLI parsing issue for Identity reducer arguments,
  • or a mismatch between the website-generated command and the current CLI behavior.

Environment

  • OS: Windows
  • Shell: Windows PowerShell
  • Server: Maincloud
  • Auth: logged in with spacetime login

What I was trying to do

The SpacetimeDB website showed:

Web identity
c2000de7bf5eeb20c27b5f117e829af4b9edf7a628d844b8f665f960fb61aaec

It told me to run:

spacetime call scrabblebot connect_id '["0xc2000de7bf5eeb20c27b5f117e829af4b9edf7a628d844b8f665f960fb61aaec"]'

Then refresh the page.

Expected behavior

The website-generated command should successfully link the browser identity to the logged-in CLI identity.

Actual behavior

The command fails on Windows PowerShell.

Reproduction attempts

Attempt 1: website-generated command
spacetime call scrabblebot connect_id '["0xc2000de7bf5eeb20c27b5f117e829af4b9edf7a628d844b8f665f960fb61aaec"]'

This was first run inside a repo directory, which caused config interference.

Attempt 2: retried outside the repo with config disabled and explicit server
spacetime call --no-config --server maincloud scrabblebot connect_id '["0xc2000de7bf5eeb20c27b5f117e829af4b9edf7a628d844b8f665f960fb61aaec"]'
Attempt 3: tuple form with raw hex identity
spacetime call --no-config --server maincloud scrabblebot connect_id '[0xc2000de7bf5eeb20c27b5f117e829af4b9edf7a628d844b8f665f960fb61aaec]'
Attempt 4: tuple form with string identity
spacetime call --no-config --server maincloud scrabblebot connect_id '["c2000de7bf5eeb20c27b5f117e829af4b9edf7a628d844b8f665f960fb61aaec"]'

Errors

Error from running inside a repo with spacetime.json
PS C:\Users\nithi\OneDrive\Documents\Spacetimedb\spacetimedb-hack> spacetime call scrabblebot connect_id '["0xc2000de7bf5eeb20c27b5f117e829af4b9edf7a628d844b8f665f960fb61aaec"]'
WARNING: This command is UNSTABLE and subject to breaking changes.

Error: No such reducer OR procedure `scrabblebot` for database `bodega-blitz` resolving to identity `c200889899a001a3ec285a3e71b0fd47ee22c8609ecd8e9d3dced0fdb9ba740a`.

Here are some existing reducers:
- set_value

The database has no procedures.
Error from tuple/raw-hex attempt
PS C:\WINDOWS\system32> spacetime call --no-config --server maincloud scrabblebot connect_id '[0xc2000de7bf5eeb20c27b5f117e829af4b9edf7a628d844b8f665f960fb61aaec]'
WARNING: This command is UNSTABLE and subject to breaking changes.

Error: Invalid arguments provided for reducer `connect_id` for database `scrabblebot` resolving to identity `c20059ea92f3dd5003584374b76bf2c9910421c217314b7b260b6e7a63b6c511`.

The reducer has the following signature:
        connect_id(web_identity: Identity)

Caused by:
    0: Response text: invalid arguments for reducer connect_id: [0][0]: invalid arguments for function connect_id: [0][0]: [0][0]: invalid type: integer `0`, expected a formatted 256-bit integer at line 1 column 3
    1: HTTP status client error (400 Bad Request) for url (https://maincloud.spacetimedb.com/v1/database/c20059ea92f3dd5003584374b76bf2c9910421c217314b7b260b6e7a63b6c511/call/connect_id)
Error from tuple/string attempt
PS C:\WINDOWS\system32> spacetime call --no-config --server maincloud scrabblebot connect_id '["c2000de7bf5eeb20c27b5f117e829af4b9edf7a628d844b8f665f960fb61aaec"]'
WARNING: This command is UNSTABLE and subject to breaking changes.

Error: Invalid arguments provided for reducer `connect_id` for database `scrabblebot` resolving to identity `c20059ea92f3dd5003584374b76bf2c9910421c217314b7b260b6e7a63b6c511`.

The reducer has the following signature:
        connect_id(web_identity: Identity)

Caused by:
    0: Response text: invalid arguments for reducer connect_id: [0][0]: invalid arguments for function connect_id: [0][0]: [0][0]: expected value at line 1 column 3
    1: HTTP status client error (400 Bad Request)

Notes

  • The browser page displayed the identity as:
c2000de7bf5eeb20c27b5f117e829af4b9edf7a628d844b8f665f960fb61aaec
  • The page-generated command used:
["0xc2000de7bf5eeb20c27b5f117e829af4b9edf7a628d844b8f665f960fb61aaec"]

That mismatch may be relevant.

Suggestion

It would help if the website generated shell-specific commands, especially for Windows PowerShell, or documented the correct Identity argument format for spacetime call.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the spacetime call CLI entry point and the argument handling for reducers with an Identity parameter. Reproduce the documented connect_id commands in Windows PowerShell and compare the website-generated format with the CLI's accepted format. Done means the browser-linking command succeeds, or the correct format and shell-specific command are documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell, rust
Domain
cli, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.