The preview thumbnail for a sandbox never updates once it is created. This affects the dashboard view and the embed preview during loading.
| Software | Name/Version |
| ---------------- | ------------ |
| 小odesandbox |
| Browser | Chrome 75.0.3770.142
| Operating System | Windows 10 / macOS
Hey @jsejcksn ,
Sorry for the delay. Indeed, there's no automatic refreshing of thumbnails ATM.
A workaround would be to manually access this URL: https://codesandbox.io/api/v1/sandboxes/sandboxId/screenshot.png .
Hi @lbogdan: Thanks for responding. Is that URL documented somewhere?
It's not documented anywhere, as it's mostly an implementation detail. 馃檪
Anyway, I'll leave this open until we find a proper solution.
Is there a way to programmatically list all IDs for sandboxes in my dashboard other than by scraping? I would like to automate generating thumbnails periodically until there's a fix.
Accessing the above mentioned url, https://codesandbox.io/api/v1/sandboxes/sandboxId/screenshot.png, doesn鈥檛 seem to generate a new screenshot. (I tried in a separate browser where the png wasn鈥檛 cached.)
A workaround seems to be to fork the sandbox (and delete the old one when you don鈥檛 want a Template reference to it).
@thijsm Still works for me.
I've checked what's going on behind the scenes. I found a good solution to make it work. Will let you know about the outcome soon.
I've updated our screenshot microservice, but it's still just a workaround.
Now, if you modify a sandbox, you can programmatically generate a new screenshot with https://codesandbox.io/api/v1/sandboxes/sandboxId/screenshot.png.
If you already had the screenshot cached in your browser, after 10 minutes it will be revalidated. So it means, in worst case, you will see the outdated screenshot for 10 minutes.
https://github.com/codesandbox/codesandbox-client/issues/2170#issuecomment-518249450:
Is there a way to programmatically list all IDs for sandboxes in my dashboard other than by scraping? I would like to automate generating thumbnails periodically until there's a fix.
@andrasbacsai Any ideas?
You can use our API endpoint (https://codesandbox.io/api/v1/sandboxes) for it.
I'm planning to modify this screenshot generating process a bit, so you do not have to do anything manually.
You can also play with our GraphQL & get data from it: https://codesandbox.io/api/graphiql
@andrasbacsai Thanks for the information! I want to help keep the comments on-topic for this issue, but I'm interested in knowing more about the GraphQL and REST APIs. Where is the place for that (more info and/or discussion)?
We have updated our screenshot service.
If you are on your dashboard and the screenshot of a sandbox in the current view (means you see it on your screen) is obsolete (means you have changed the code since the last screenshot), it will be regenerated automatically. :tada:
About the place for discussion: we only have Github for that, for example, the Discussions menu.
Closing as it has been resolved 馃帀
Most helpful comment
We have updated our screenshot service.
If you are on your dashboard and the screenshot of a sandbox in the current view (means you see it on your screen) is obsolete (means you have changed the code since the last screenshot), it will be regenerated automatically. :tada:
About the place for discussion: we only have Github for that, for example, the
Discussionsmenu.