The fix: the profile update handler schedules a background task via TaskScheduler to update member events in all joined rooms. This task involves DB operations in executor threads, which need real event loop time to
complete. Added a polling loop that waits for the scheduled task to finish before asserting on the room state.