I would avoid Math.random here. What we should do instead is not set any value and wait for some other code to call current message, and we should just throw in message_cursor if someone for example calls advance/next/previous without having a current message id.