Skip to content

Commit 58d56d5

Browse files
authored
increase size of entity_type on cluster_messages table (#5345)
1 parent a8c314e commit 58d56d5

File tree

7 files changed

+398
-275
lines changed

7 files changed

+398
-275
lines changed

.changeset/hot-cases-attend.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@effect/cluster": patch
3+
---
4+
5+
increase size of entity_type on cluster_messages table

.changeset/hot-spies-occur.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
"@effect/workflow": patch
3+
"@effect/cluster": patch
4+
---
5+
6+
log defects in Entity & Workflow proxy for HttpApi endpoints

packages/cluster/src/EntityProxy.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,10 @@ export const toHttpApiGroup = <const Name extends string, Type extends string, R
172172
.addSuccess(parentRpc.successSchema)
173173
.addError(Schema.Union(parentRpc.errorSchema, ...clientErrors))
174174
.annotateContext(parentRpc.annotations)
175-
const endpointDiscard = HttpApiEndpoint.post(parentRpc._tag, `/${tagToPath(parentRpc._tag)}/:entityId/discard`)
175+
const endpointDiscard = HttpApiEndpoint.post(
176+
`${parentRpc._tag}Discard`,
177+
`/${tagToPath(parentRpc._tag)}/:entityId/discard`
178+
)
176179
.setPath(entityIdPath)
177180
.setPayload(parentRpc.payloadSchema)
178181
.addError(Schema.Union(...clientErrors))

packages/cluster/src/EntityProxyServer.ts

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,12 +40,33 @@ export const layerHttpApi = <
4040
.handle(
4141
parentRpc._tag as any,
4242
(({ path, payload }: { path: { entityId: string }; payload: any }) =>
43-
(client(path.entityId) as any)[parentRpc._tag](payload)) as any
43+
(client(path.entityId) as any as Record<string, (p: any) => Effect.Effect<any>>)[parentRpc._tag](
44+
payload
45+
).pipe(
46+
Effect.tapDefect(Effect.logError),
47+
Effect.annotateLogs({
48+
module: "EntityProxyServer",
49+
entity: entity.type,
50+
entityId: path.entityId,
51+
method: parentRpc._tag
52+
})
53+
)) as any
4454
)
4555
.handle(
4656
`${parentRpc._tag}Discard` as any,
4757
(({ path, payload }: { path: { entityId: string }; payload: any }) =>
48-
(client(path.entityId) as any)[parentRpc._tag](payload, { discard: true })) as any
58+
(client(path.entityId) as any as Record<string, (p: any, o: {}) => Effect.Effect<any>>)[parentRpc._tag](
59+
payload,
60+
{ discard: true }
61+
).pipe(
62+
Effect.tapDefect(Effect.logError),
63+
Effect.annotateLogs({
64+
module: "EntityProxyServer",
65+
entity: entity.type,
66+
entityId: path.entityId,
67+
method: `${parentRpc._tag}Discard`
68+
})
69+
)) as any
4970
) as any
5071
}
5172
return handlers as HttpApiBuilder.Handlers<never, never, never>

0 commit comments

Comments
 (0)