Skip to content

Commit

Permalink
fix(account): wait for edge update (#1837)
Browse files Browse the repository at this point in the history
* fix(account): wait for edge update

* wip

* wip

* fix
  • Loading branch information
maurerbot authored Mar 3, 2023
1 parent d9292ec commit 337c726
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 12 deletions.
1 change: 1 addition & 0 deletions apps/passport/app/routes/connect/apple/callback.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export const loader: LoaderFunction = async ({ request, context }) => {
name: user?.name,
sub: token.sub,
picture: '',
isApple: true,
}

const address = AddressURNSpace.componentizedUrn(
Expand Down
6 changes: 3 additions & 3 deletions packages/platform-middleware/edges.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import { BaseContext } from '@kubelt/types'

export const InjectEdges: BaseMiddlewareFunction<
{
EDGES?: Fetcher
Edges?: Fetcher
} & BaseContext
> = ({ ctx, next }) => {
if (!ctx.EDGES) throw new Error('No EDGES binding found in context')
const edgesClient = createEdgesClient(ctx.EDGES)
if (!ctx.Edges) throw new Error('No Edges binding found in context')
const edgesClient = createEdgesClient(ctx.Edges)

return next({
ctx: {
Expand Down
2 changes: 1 addition & 1 deletion platform/access/src/context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ interface CreateInnerContextOptions
authorization?: Authorization
Starbase: Fetcher
starbaseClient?: ReturnType<typeof createStarbaseClient>
EDGES: Fetcher
Edges: Fetcher
Account: Fetcher
accountClient?: ReturnType<typeof createAccountClient>
// Added by InjectEdges middleware.
Expand Down
2 changes: 1 addition & 1 deletion platform/access/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export interface Environment {
Authorization: DurableObjectNamespace
Analytics: AnalyticsEngineDataset
ServiceDeploymentMetadata: DeploymentMetadata
EDGES: Fetcher
Edges: Fetcher
Starbase: Fetcher
Account: Fetcher
INTERNAL_JWT_ISS: string
Expand Down
8 changes: 4 additions & 4 deletions platform/access/wrangler.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ durable_objects.bindings = [
{ name = "Authorization", class_name = "Authorization" },
]
services = [
{ binding = "EDGES", service = "edges" },
{ binding = "Edges", service = "edges" },
{ binding = "Starbase", service = "starbase" },
{ binding = "Account", service = "account" },
]
Expand All @@ -33,7 +33,7 @@ durable_objects.bindings = [
{ name = "Authorization", class_name = "Authorization" },
]
services = [
{ binding = "EDGES", service = "edges-dev" },
{ binding = "Edges", service = "edges-dev" },
{ binding = "Starbase", service = "starbase-dev" },
{ binding = "Account", service = "account-dev" },
]
Expand All @@ -53,7 +53,7 @@ durable_objects.bindings = [
{ name = "Authorization", class_name = "Authorization" },
]
services = [
{ binding = "EDGES", service = "edges-next" },
{ binding = "Edges", service = "edges-next" },
{ binding = "Starbase", service = "starbase-next" },
{ binding = "Account", service = "account-next" },
]
Expand All @@ -73,7 +73,7 @@ durable_objects.bindings = [
{ name = "Authorization", class_name = "Authorization" },
]
services = [
{ binding = "EDGES", service = "edges-current" },
{ binding = "Edges", service = "edges-current" },
{ binding = "Starbase", service = "starbase-current" },
{ binding = "Account", service = "account-current" },
]
Expand Down
4 changes: 1 addition & 3 deletions platform/account/src/jsonrpc/methods/setProfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,7 @@ export const setProfileMethod = async ({
)

const edge = ctx.edges
// Don't need to await it
// Fire and go
edge.updateNode.mutate({ urnOfNode: enhancedUrn })
await edge.updateNode.mutate({ urnOfNode: enhancedUrn })
}
return
}

0 comments on commit 337c726

Please sign in to comment.