From the frontend I call room.disconnect() and then I call a backend service `/end to pull some data from Redis that I set in the Agent shutdown callback.
The issue is that `/end` is called too soon, way before the Agent shutdown callback is done.
What's a good way for to check if the Agent shutdown callback is done executing.
Don’t use room.disconnect() / ParticipantDisconnected as your sync point. Instead, have the agent explicitly ACK completion: after the Redis write in the shutdown logic, call a webhook/backend endpoint (e.g. /agent-finished). Then /end should wait for (or check) that “finished” flag before reading Redis. This removes the race and avoids relying on room timing.