I'm getting a recursion issue in Python when receiving an event from Typescript over the Redis Bridge. I have both cross wired with the Redis Bridge, see code below. These are running on Docker images
python:3.13-slim
python: 3.13
abxbus: 2.5.6
redis: 7.4.0
node:25-slim
typescript: 6.0.3
abxbus: 2.5.6
ioredis: 5.10.1
zod: 4.4.2
Python:
async def handle(event: BaseEvent[Any]) -> None:
print(f"Received:\tType: {event.event_type}\tID: {event.event_id}")
async def main():
bus.on("*", bridge.emit)
bridge.on("*", bus.emit)
bus.on("*", handle)
await asyncio.Future() # Wait forever
if __name__ == "__main__":
asyncio.run(main())
Typescript:
const handle = async (event: BaseEvent<any>) => {
console.log(`Received:\tType: ${event.event_type}\tID: ${event.event_id}`)
}
const FrontendEvent = BaseEvent.extend('FrontendEvent', {
message: z.string(),
})
bus.on('*', bridge.emit)
bridge.on('*', bus.emit)
bus.on('*', handle)
async function main() {
// Emit a test event inline
await sleep(4000)
await bus.emit(FrontendEvent({ message: 'Hello from Frontend!' }))
await new Promise(() => {}) // Wait forever
}
main().catch(console.error)
When running, the event is emitted from the TypeScript( frontend-1) and its handler picks up the event. The event is sent over the Redis bridge to Python(backend-1) and the event bus. It looks like the cross wiring on the Python side is trying to emit the event back to the bridge and the Redis Bridge is catching it and throwing the error:
frontend-1 | Received: Type: FrontendEvent ID: 019e4348-9f25-70b3-98ba-8cd09ea06572
backend-1 | ❌ EventBus#2585🟢(queue=0 active=1 history=1 handlers=2) Error in event handler RedisEventBridge.emit(EventBus#2585▶ FrontendEvent#86a5 🏃) ->
backend-1 | PydanticSerializationError(Error calling function `event_result_type_serializer`: RecursionError)
backend-1 | pydantic_core._pydantic_core.PydanticSerializationError: Error calling function `event_result_type_serializer`: RecursionError
backend-1 |
backend-1 | Received: Type: FrontendEvent ID: 06a0d20e-d633-7edf-8000-e7ac577686a5
If I comment out python bus.on("*", bridge.emit), the error is not thrown.
If you need more information, please let me know.
I'm getting a recursion issue in Python when receiving an event from Typescript over the Redis Bridge. I have both cross wired with the Redis Bridge, see code below. These are running on Docker images
python:3.13-slim
python: 3.13
abxbus: 2.5.6
redis: 7.4.0
node:25-slim
typescript: 6.0.3
abxbus: 2.5.6
ioredis: 5.10.1
zod: 4.4.2
Python:
Typescript:
When running, the event is emitted from the TypeScript( frontend-1) and its handler picks up the event. The event is sent over the Redis bridge to Python(backend-1) and the event bus. It looks like the cross wiring on the Python side is trying to emit the event back to the bridge and the Redis Bridge is catching it and throwing the error:
If I comment out
python bus.on("*", bridge.emit), the error is not thrown.If you need more information, please let me know.