Bug: await skipped if user not logged in

If I run this sample code while logged out, it shows all the numbers printed by the loop at once, apparently without waiting for the await. This happens if I reload the page.

If I log in, the loop functions as expected, pausing for 2 seconds after 3.

Sorry, just to understand: are you saying that it loads immediately after a refresh? Or are you saying that if you manually re-run after a refresh, it somehow happens immediately?

If it is the former, I think there may be some misunderstanding as to the way RunKit works. The code is not re-run on every refresh. The author controls the running of the code (either by hitting shift+enter, or by clicking the run button). Once the code is run, others that visit the page, or you yourself refreshing, simply shows these same results.

If it’s the latter, and creating a document without a log in and hitting shift+enter causes them to appear immediately then that would certainly be a bug. But want to just confirm which of these two it is first.

I see - it was the former indeed.

I think there may be some misunderstanding as to the way RunKit works. The code is not re-run on every refresh. The author controls the running of the code (either by hitting shift+enter, or by clicking the run button). Once the code is run, others that visit the page, or you yourself refreshing, simply shows these same results.

This clears things up for me, but it tripped me at first, and it confused other users in this SO answer, where I had used RunKit initially. Screenshot below for posterity (I marked some comments as no longer necessary):