Problem with retrieving the room name and metadata
Opened this issue · 1 comments
love4php commented
In the worker, I am trying to obtain the room name and metadata using the following method, but unfortunately, after the latest update, these two values are no longer displayed.
`async def entrypoint(ctx: JobContext):
try:
print(ctx.room.name)
print(ctx.room.metadata)
if name == "main":
# Initialize the worker with the entrypoint
cli.run_app(WorkerOptions(entrypoint_fnc=entrypoint))
`
keepingitneil commented
I pushed a fix to today to participant metadata: #226 but I'm unable to reproduce your issue for room metadata.
For example, this code:
lkapi = livekit.api.LiveKitAPI()
await lkapi.room.update_room_metadata(
livekit.api.UpdateRoomMetadataRequest(room=ctx.room.name, metadata="test")
)
await asyncio.sleep(1)
print("room md", ctx.room.metadata)
prints "room md test" as expected.