-
Notifications
You must be signed in to change notification settings - Fork 10
Upgrade geo sdk 2 #591
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
Upgrade geo sdk 2 #591
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Upgrades @geoprotocol/geo-sdk across the monorepo and aligns code with updated geo-sdk/GRC-20 type naming, while stubbing out removed Graph.createSpace functionality.
Changes:
- Bump
@geoprotocol/geo-sdkfrom^0.3.0to^0.8.0(lockfile + all package dependents). - Update value/property type strings (
FLOAT64→FLOAT,float64→float,bool→boolean) in mapping, publishing, and example apps. - Replace
Graph.createSpaceusage with placeholder warnings/alerts where the upstream API was removed.
Reviewed changes
Copilot reviewed 21 out of 22 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| pnpm-lock.yaml | Updates resolved dependency graph for geo-sdk and related transitive deps. |
| package.json | Bumps root dependency on @geoprotocol/geo-sdk to ^0.8.0. |
| packages/typesync-studio/package.json | Bumps geo-sdk dependency to ^0.8.0. |
| packages/hypergraph/package.json | Bumps geo-sdk dependency to ^0.8.0. |
| packages/hypergraph/src/mapping/Mapping.ts | Maps schema Number type to FLOAT instead of FLOAT64. |
| packages/hypergraph/test/mapping/Mapping.test.ts | Updates expectation to FLOAT mapping. |
| packages/hypergraph-react/package.json | Bumps geo-sdk dependency to ^0.8.0. |
| packages/hypergraph-react/src/prepare-publish.ts | Updates published value type tags (bool/float64 → boolean/float). |
| packages/hypergraph-react/src/hooks/use-privy-auth-create-public-space.ts | Replaces removed public-space creation with an alert-based placeholder. |
| packages/hypergraph-react/src/HypergraphAppContext.tsx | Removes geo-sdk public-space creation call; logs a warning instead. |
| apps/privy-login-example/package.json | Bumps geo-sdk dependency to ^0.8.0. |
| apps/privy-login-example/src/components/create-properties-and-types-todos.tsx | Updates property dataType to FLOAT. |
| apps/privy-login-example/src/components/create-properties-and-types-event.tsx | Updates property dataType to FLOAT. |
| apps/privy-login-example/src/components/create-events.tsx | Updates value type to float. |
| apps/next-example/package.json | Bumps geo-sdk dependency to ^0.8.0. |
| apps/events/package.json | Bumps geo-sdk dependency to ^0.8.0. |
| apps/events/src/components/create-properties-and-types-todos.tsx | Updates property dataType to FLOAT. |
| apps/events/src/components/create-properties-and-types-event.tsx | Updates property dataType to FLOAT. |
| apps/events/src/components/create-events.tsx | Updates value type to float. |
| apps/connect/package.json | Bumps geo-sdk dependency to ^0.8.0. |
| apps/connect/src/components/CreateSpaceCard.tsx | Replaces public-space creation with an alert placeholder. |
| .changeset/upgrade-geo-sdk-types.md | Adds changeset describing type renames and createSpace stubbing. |
Files not reviewed (1)
- pnpm-lock.yaml: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| alert('Graph.createSpace has been removed. Public space creation needs to be re-implemented.'); | ||
| return undefined; |
Copilot
AI
Feb 10, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
usePrivyAuthCreatePublicSpace currently calls alert(...). This is problematic for a library hook because it introduces a hard browser dependency (will throw in SSR/Node where alert is undefined) and forces a UI side-effect on consumers. Prefer returning a typed error/Result or throwing an Error so callers can render their own UX (and consider deprecating/removing the hook if the feature is no longer supported).
| alert('Graph.createSpace has been removed. Public space creation needs to be re-implemented.'); | |
| return undefined; | |
| throw new Error('Graph.createSpace has been removed. Public space creation needs to be re-implemented.'); |
| const [isLoading] = useState(false); | ||
|
|
||
| const createPublicSpace = async ({ name }: CreatePublicSpaceParams) => { | ||
| const accountAddress = privyIdentity?.accountAddress; | ||
| if (!accountAddress) { | ||
| throw new Error('No account address found'); | ||
| } | ||
| try { | ||
| setIsLoading(true); | ||
| const { id } = await Graph.createSpace({ | ||
| editorAddress: accountAddress, | ||
| name, | ||
| network: 'TESTNET', | ||
| }); | ||
| queryClient.invalidateQueries({ queryKey: ['hypergraph-public-spaces'] }); | ||
| setIsLoading(false); | ||
| return id; | ||
| } catch (error) { | ||
| setIsLoading(false); | ||
| throw error; | ||
| } | ||
| const createPublicSpace = async ({ name: _name }: CreatePublicSpaceParams) => { | ||
| alert('Graph.createSpace has been removed. Public space creation needs to be re-implemented.'); | ||
| return undefined; |
Copilot
AI
Feb 10, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isLoading is created via useState(false) but the setter is removed, so it will always be false and cannot reflect the async operation state. Either remove React state entirely (use a constant) or restore setIsLoading and set it appropriately (even if the function now throws/returns an error).
| const createPublicSpace = async () => { | ||
| if (!accountAddress) { | ||
| alert('Missing account address'); | ||
| return; | ||
| } | ||
|
|
||
| setIsLoading(true); | ||
|
|
||
| try { | ||
| await Graph.createSpace({ | ||
| editorAddress: accountAddress, | ||
| name: spaceName, | ||
| network: 'TESTNET', | ||
| }); | ||
| } catch (error) { | ||
| alert('Failed to create space'); | ||
| console.error(error); | ||
| } finally { | ||
| setIsLoading(false); | ||
| queryClient.invalidateQueries({ queryKey: ['public-spaces'] }); | ||
| } | ||
| alert('Graph.createSpace has been removed. Public space creation needs to be re-implemented.'); | ||
| return; | ||
| }; |
Copilot
AI
Feb 10, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
createPublicSpace now no-ops with an alert(...) but the UI still offers a "public" option. Consider disabling/removing the public-space path until it’s re-implemented (or wire it to a real implementation) to avoid confusing users and to prevent repeated submissions since isLoading is never set for this branch.
| "@graphprotocol/hypergraph": patch | ||
| "@graphprotocol/hypergraph-react": patch | ||
| --- | ||
|
|
||
| Update geo-sdk type names: float64 to float, bool to boolean. Replace removed Graph.createSpace calls with no-op alerts. |
Copilot
AI
Feb 10, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changeset marks both packages as patch, but this PR removes/neutralizes public space creation behavior (and changes observable outputs like createPublicSpace becoming a no-op). If consumers rely on this functionality, this is a breaking behavioral change and likely warrants at least a minor (or major) bump and clearer release notes about the removed capability.
| "@graphprotocol/hypergraph": patch | |
| "@graphprotocol/hypergraph-react": patch | |
| --- | |
| Update geo-sdk type names: float64 to float, bool to boolean. Replace removed Graph.createSpace calls with no-op alerts. | |
| "@graphprotocol/hypergraph": minor | |
| "@graphprotocol/hypergraph-react": minor | |
| --- | |
| BREAKING: Update geo-sdk type names (float64 to float, bool to boolean) and remove public space creation behavior by turning Graph.createSpace calls into no-op alerts. |
| const spaceId = Utils.generateId(); | ||
|
|
||
| try { | ||
| if (smartSessionClient?.account) { | ||
| const result = await Graph.createSpace({ | ||
| editorAddress: smartSessionClient.account.address, | ||
| name, | ||
| network: smartSessionClient.chain.id === Connect.GEO_TESTNET.id ? 'TESTNET' : 'TESTNET', // TODO: switch to mainnet | ||
| }); | ||
| spaceId = result.id; | ||
| console.log('Created public space', spaceId); | ||
| } | ||
| } catch (error) { | ||
| console.error('Error creating public space', error); | ||
| if (smartSessionClient?.account) { | ||
| // TODO: Graph.createSpace has been removed. Public space creation needs to be re-implemented. | ||
| console.warn('Graph.createSpace has been removed. Public space creation needs to be re-implemented.'); | ||
| } |
Copilot
AI
Feb 10, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
createSpaceForContext previously attempted to create a public space via the geo-sdk when smartSessionClient.account was present; it now always proceeds without creating the corresponding public space and only logs a warning. If the rest of the app assumes the space exists publicly after this call, this will cause runtime behavior regressions—consider surfacing an explicit error/feature flag instead of silently continuing, or adjust upstream callers/UX to reflect that public spaces can’t be created right now.
No description provided.