-
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| --- | ||
| "@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. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,3 @@ | ||
| import { Graph } from '@geoprotocol/geo-sdk'; | ||
| import { Key, type Messages, SpaceEvents, SpaceInfo, StoreConnect, Utils } from '@graphprotocol/hypergraph'; | ||
| import { useIdentityToken } from '@privy-io/react-auth'; | ||
| import { useQueryClient } from '@tanstack/react-query'; | ||
|
|
@@ -20,26 +19,8 @@ export function CreateSpaceCard({ className, ...props }: CreateSpaceCardProps) { | |
| const queryClient = useQueryClient(); | ||
|
|
||
| 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; | ||
| }; | ||
|
Comment on lines
21
to
24
|
||
|
|
||
| const createPrivateSpace = async () => { | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,7 +5,6 @@ import * as automerge from '@automerge/automerge/slim'; | |
| import type { DocHandle } from '@automerge/automerge-repo'; | ||
| import { Repo } from '@automerge/automerge-repo/slim'; | ||
| import { RepoContext } from '@automerge/automerge-repo-react-hooks'; | ||
| import { Graph } from '@geoprotocol/geo-sdk'; | ||
| import { | ||
| Config, | ||
| Connect, | ||
|
|
@@ -961,20 +960,11 @@ export function HypergraphAppProvider({ | |
| throw new Error('Missing keys'); | ||
| } | ||
|
|
||
| let spaceId = Utils.generateId(); | ||
| 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.'); | ||
| } | ||
|
Comment on lines
+963
to
968
|
||
|
|
||
| const spaceEvent = await Effect.runPromise( | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
| @@ -1,36 +1,15 @@ | ||||||||
| import { Graph } from '@geoprotocol/geo-sdk'; | ||||||||
| import { useQueryClient } from '@tanstack/react-query'; | ||||||||
| import { useState } from 'react'; | ||||||||
| import { useHypergraphAuth } from '../HypergraphAppContext.js'; | ||||||||
|
|
||||||||
| type CreatePublicSpaceParams = { | ||||||||
| name: string; | ||||||||
| }; | ||||||||
|
|
||||||||
| export const usePrivyAuthCreatePublicSpace = () => { | ||||||||
| const [isLoading, setIsLoading] = useState(false); | ||||||||
| const queryClient = useQueryClient(); | ||||||||
| const { privyIdentity } = useHypergraphAuth(); | ||||||||
| 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; | ||||||||
|
Comment on lines
+11
to
+12
|
||||||||
| 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.'); |
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).
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 likecreatePublicSpacebecoming a no-op). If consumers rely on this functionality, this is a breaking behavioral change and likely warrants at least aminor(ormajor) bump and clearer release notes about the removed capability.