Description
Switching between buckets/View definitions in the UI, the 'Random Document' can look for a random document in a previous bucket.
For example, if I open the Beer sample database, then create a new bucket, populate it with data, and create a new View, the default 'Random document' has a 'Beer_....' prefix as if it's looking for the old document. Repeated 'Preview a Random Document' clicks still try a random Beer doc.
Only by quitting out and going back in, can you get a valid random preview document.
Furthermore, it is possible to get the Design document as a random sample document, which should be impossible, we should only be displaying user data as the sample documents.